Oracle Portal Configuration Guide Release 3.0.8 Part Number A87566-01 |
Library | Service | Contents | Index

# 7
Setting Up the Search Feature in Oracle Portal Content Areas

This chapter provides information on setting up the built-in interMedia Text search capabilities in Oracle Portal content areas.

This chapter contains the following sections:

- Prerequisites

- Searching in Oracle Portal

- Setting Up interMedia Text Searching

- Dropping an interMedia Text Index

- Setting Up Your Environment for interMedia Text

- Multilingual Functionality (Multilexer)

- interMedia Text-related Procedures Created in Oracle Portal

See also: For interMedia Text documentation, see your Oracle8i database documentation library. For interMedia Text technical papers, training materials, code samples, and so on, visit: `http://technet.oracle.com/products/intermedia`

## 7.1 Prerequisites

You must be logged on as an Oracle Portal administrator to configure interMedia Text, and create, alter, update, and drop interMedia Text indexes.

Before using interMedia Text into Oracle Portal, perform the following tasks:

  Install and configure the Oracle8i database with the interMedia Text option by running the Oracle Universal Installer (OUI) and the Database Configuration Assistant. See the Oracle8i installation documentation for more information about installing and configuring an Oracle8i database to use interMedia Text.

Important: If you are planning to enable interMedia Text in Oracle Portal on Windows NT/2000, the following requirements apply: Oracle Portal must be installed in an Oracle 8.1.7 database. Disable connection pooling from the Database Access Descriptor page. See "Accessing the Gateway DAD Configuration Page" to access this page.

  Install Oracle Portal 3.0 according to the instructions provided in the "Oracle9 i Application Server Installation Guide" for your particular operating system.

  Create an Oracle Portal content area using the Content Area Creation Manager. See the "Creating a content area" topic in the Oracle Portal Online Help content area.

  If this database was an existing ConText site, make sure to remove `text_enable` from the `init.ora` file. It is no longer used in Oracle8i, and actually prevents Oracle8i from operating properly. The error, "cannot find package DR_REWRITE" may appear.

See also: For a complete list of system requirements, see Chapter 1, "Verifying Requirements", Section 1.1, "System Requirements".

### 7.1.1 interMedia Text On UNIX

For the interMedia Text feature to work, set the following UNIX environment variables before starting the Oracle8i database and Net8 Listener.

##### Korn Shell (ksh)

    LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/ctx/lib
    export LD_LIBRARY_PATH

##### C-Shell (csh)

    setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${ORACLE_HOME}/ctx/lib

## 7.2 Searching in Oracle Portal

The main points when searching in Oracle Portal content areas include:

- interMedia Text searching in Oracle Portal is available in content areas only. Searches on Oracle Portal pages is performed from the Oracle Portal Navigator and searches on applications (and content areas) is performed with the Oracle Portal Search portlet. See the "Adding search capabilities on your page" help topic in the Oracle Portal Online Help Content Area.

- When search is enabled in Oracle Portal, search is enabled for all content areas created in your Oracle Portal installation. It cannot be enabled on one content area and disabled on another content area. Search results, however, are restricted to the content area on which the search is performed.

- There are two levels and two modes of searching in Oracle Portal content areas depending on the type of search you use: basic search, advanced search, and interMedia Text search. The distinctions are summarized in the following table:

##### Table 7-1 interMedia Text search types

| Basic Search | Advanced Search
--- | --- | ---
Availability | From Search field on Navigation Bar as shown. | From Advanced Search screen as shown.
interMedia Text is disabled | Searches on the item attributes such as display name, description, and keywords of items. Automatically uses wildcards. Example: If you search on "sing,", the results of the search include: sing, single, tossing.
interMedia Text is enabled | Searches on the item attributes such as display name, description, and keywords of items. Searches in the content of documents and URLs. Uses STEM searching. Examples: If you search on "distinguish," the results of the search include: distinguish, distinguished, distinguishes. If you search on "sing," the results of the search include: sing, sang, sung.

### 7.2.1 Basic Search

This type of search looks for the specified words in the item attributes such as the display name, description, and keywords of items, as well as the display name and description of folders, categories, and perspectives are searched. If interMedia Text is enabled, basic search also looks in the content of documents and URLs. A search results page displays all items with this criteria.

Typically, a Search field appears on the Navigation bar enabling end uses to perform a basic search as shown below:

#### Figure 7-1 Basic search screen in Oracle Portal

Text description of the illustration basicsea.gif

See also: The following topics in the Oracle Portal Online Help content area which is installed with the Oracle Portal: "Performing a basic search" "Setting up the search feature" "Editing navigation bars"

### 7.2.2 Advanced Search

With advanced search (which is always enabled), you can:

- Find content that contains any of the specified words.

- Search across a content area other than the current content area, or across all content areas.

- Restrict the search to a particular folder, category, perspective, item type, or attribute.

- If interMedia Text is enabled, searches for near, soundex, and fuzzy items are also searched.

#### Figure 7-2 Advanced search screen in Oracle Portal

Text description of the illustration advsear.gif

See also: "Performing an Advanced Search" topic in the Oracle Portal Online Help content area which is installed with the product.

### 7.2.3 interMedia Text Search

As discussed earlier, Oracle Portal has built-in support for interMedia Text indexing. It is worth repeating that when search is enabled in Oracle Portal, search is enabled for all content areas created in your Oracle Portal installation. It cannot be enabled on one content area and disabled on another content area. Search results, however, are restricted to the content area on which the search is performed. The search is performed on the actual content in documents such as PDF, PowerPoint, and Word as well as the contents on URL pages, text, and HTML.

If interMedia Text is not enabled, end users can always perform a basic or advanced search in the content area.

### 7.2.4 Viewing interMedia Text Search Results

If themes and gists are enabled from the Search Settings page (see figure), then you can access the themes and gists for documents returned by a search from the search results. You can:

- View an HTML version of the file.

- View an HTML version of the file with search terms highlighted in any color or font set by the Oracle Portal administrator.

- View major themes in a chart (document theme analysis).

- View a short summary about the file's content (gist).

See also: "Step 2: Enable interMedia Text Searching"

## 7.3 Setting Up interMedia Text Searching

There are four main steps for setting up interMedia Text in Oracle Portal:

- Step 1: Set Up the Global Page Settings

- Step 2: Enable interMedia Text Searching

- Step 3: Create an interMedia Text Index

- Step 4: Maintain interMedia Text Index

Note: To obtain additional information for any Oracle Portal configuration page, click the small Help icon Text description of the illustration helps.gif displayed on the page.

### 7.3.1 Step 1: Set Up the Global Page Settings

The first step requires you to configure the global page settings in the following way:

1. In the Services portlet, click Global Settings. By default, the Services portlet is located on the Oracle Portal home page's Administer tab.

#### Figure 7-3 Global page settings - Proxy Server

Text description of the illustration interm1.gif
- In the Proxy Server section:

  1. Enter the host name of your proxy server for the HTTP Server.

     Note: Do not prefix `http://` to the proxy server name.

  2. Enter the domains that you do not want redirected to the proxy server.

  3. Enter the maximum amount of time (in seconds) that a connection should be attempted before timing out.

- Click OK.

  ### 7.3.2 Step 2: Enable interMedia Text Searching

  Before creating the interMedia Text indexes, configure the interMedia Text settings in Oracle Portal in the following way:

  1. In the Services portlet, click Search Settings. By default, the Services portlet is located on the Oracle Portal home page's Administer tab.

  #### Figure 7-4 Services portlet - interMedia Text properties

  Text description of the illustration interm2.gif

  Note: If you see the message, "interMedia Text is not installed", interMedia Text was not installed with the database and is not available for your content areas. Arrange with your database administrator to have interMedia Text installed.

  1. Select Enable interMedia Text Searching to make interMedia Text searching available in your content areas.

  2. Select Enable Themes And Gists to create a theme and gist for each item returned by the search.

     - A theme shows the nouns and verbs that occur most frequently within the item.

     - A gist displays a brief summary of the item, derived from how frequently those nouns and verbs appear.

       Note: Themes and gists are not available for all languages.

  3. In the Highlight Text Color list, choose the color to highlight the search words in the HTML renditions of the items returned by the search.

  4. In the Highlight Text Style list, choose the style to apply to the search words in the HTML renditions of the items returned by the search.

  5. Click OK.

  Now that you've enabled interMedia Text, you'll need to create a new interMedia Text index.

  ### 7.3.3 Step 3: Create an interMedia Text Index

  To create an interMedia Text index:

  1. Make sure that you have configured the interMedia Text settings in Oracle Portal as discussed in the previous section, Section 7.3.2, "Step 2: Enable interMedia Text Searching".

  2. In the Specify interMedia Text Search Properties section, as shown on the previous page, click Create Index.

     - If properly run, the message "Index created" appears and the interMedia Text index is created on the server.

     - If you fail to create the index, check that your system has met all the requirements in Section 7.1, "Prerequisites".

  Notes: The time required for creating indexes varies depending on the number of items you have in your content area. You can also run the following command in SQL*Plus: `ctxcrind.sql` This file is located in the `<ORACLE_HOME>/portal30/src/wws` directory. Log on using the user name and password for the schema that owns the Oracle Portal content area. For example, if the schema is named "SCOTT", log on with user name and password, "SCOTT".

  The following interMedia Text indexes are created:

  Table 7-2 interMedia Text indexes created

  Index Name | Description
  --- | ---
  WWSBR_CORNER_CTX_INDX | Index based on folders.
  WWSBR_DOC_CTX_INDX | Index based on the content of uploaded documents.
  WWSBR_PERSP_CTX_INDX | Index based on perspectives.
  WWSBR_THING_CTX_INDX | Index based on items.
  WWSBR_TOPIC_CTX_INDX | Index based on categories.
  WWSBR_URL_CTX_INDX | Index based on the objects' Uniform Resource Locator (URL).

  See also: If you encounter problems creating an interMedia Text index, see "Problem: Unable to create interMedia Text indexes.".

  ### 7.3.4 Step 4: Maintain interMedia Text Index

  interMedia Text lets you create a text index (an inverted index) on documents stored in the database. Updating an inverted index requires heavy processing, so changes to a text column are queued and processed in batch. The process of updating the inverted index based on the queue is referred to as "synchronizing" the index.

  The second aspect of maintaining your interMedia Text index is optimizing. As your index is synchronized, it grows in such a way as to consume more disk space than necessary and reduces the efficiency of queries.

  Optimizing your index works differently depending on the mode you select. Optimizing in FAST MODE works on the entire index and compacts fragmented rows, but does not remove old data. FULL MODE permits optimization of the whole index or a portion of the index and both compacts fragmented rows and removes old data. For more information, see the "Oracle8i interMedia Text Reference" for the ALTER INDEX command.

  interMedia Text gives you full control over how often each text index is synchronized. You can choose to synchronize every five seconds, for example, if it is important for your application to reflect text changes quickly in the index. Or, choose to synchronize once a day, for more efficient use of computing resources and a more optimal index.

  After creating your interMedia Text index, you'll need to consider a strategy for maintaining the index. For example, if you have many inserts, updates, or deletes (DML) throughout the day, consider synchronizing the interMedia Text index on a daily basis.

  #### 7.3.4.1 Synchronize the interMedia Text Index

  The following example assumes that you've installed `ctx_schedule`.

  1. Log on to SQL*Plus with the appropriate username and password.

  2. Enter the following commands:

         exec ctx_schedule.startup ( 'ex1_index', 'SYNC', 1 ) ;
         exec ctx_schedule.startup ( 'ex1_index', 'OPTIMIZE FAST', 120 ) ;

  In this example, the index `ex1_index` is synchronized every minute, and optimized every two (2) hours. This is true even if the database is shutdown and restarted.

  #### 7.3.4.2 Stop Index Maintenance

  1. Log on to SQL*Plus with the appropriate username and password:

  2. Enter the following commands:

         exec ctx_schedule.stop ( 'ex1_index' ) ;
         exec ctx_schedule.stop ( 'ex1_index', 'OPTIMIZE FAST' ) ;

     `ctx_schedule.stop` assumes that the operation to be stopped is 'SYNC', unless you specify otherwise.

  Notes: If you want new text to be searched immediately (every five seconds), consider using the `drbgdml.sql` script located in: `<ORACLE_HOME>/ctx/sample/script/drbgdml.sql` To obtain the `ctx_schedule` script, visit Oracle Support Services at: `http://support.oracle.com/home.html` The Context Server (ctxsrv) has been deprecated and should no longer be used. Use `drbgdml.sql` instead.

  ## 7.4 Dropping an interMedia Text Index

  Dropping an index is a very time-consuming and resource-intensive operation so plan this task during non-business hours.

  You would drop an interMedia Text index in the following situations:

  - You want to disable interMedia Text and switch back to a basic and advanced search only.

  - You know that a significant amount of new content has been added to your content area. First, drop your index, then, recreate your index.

  You can drop interMedia Text indexes in the following ways:

  1. In the Services portlet, click Search Settings. By default, the Services portlet is located on the Oracle Portal home page's Administer tab.

  2. In the interMedia Text Properties section, click Drop Index.

     The interMedia Text index is dropped from the server.

  Note: You can also drop an interMedia Text Index, by running the following script in Oracle SQL*Plus and logging in as the Oracle Portal schema owner: `ctxdrind.sql`

  ## 7.5 Setting Up Your Environment for interMedia Text

  For Oracle8i Release 8.1.6.2 on UNIX, configure the `listener.ora` and `tnsnames.ora` files in your Oracle8i Home directory to support these external procedures. On Windows NT/2000, you require an Oracle 8.1.7 database if you want to use interMedia Text with Oracle Portal.

  Note: If you are running Oracle8i Release 8.1.7, ignore this section as the database does not use external procedures to perform document filtering.

  The `listener.ora` and `tnsnames.ora` files on your computer should look similar to the following examples:

  ### 7.5.1 listener.ora

  The following lines define a complete listener definition in your `listener.ora` file.

      LISTENER =
         (DESCRIPTION_LIST =
         (DESCRIPTION =
         (ADDRESS_LIST =
         (ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC0))
                          )
         (ADDRESS_LIST =
         (ADDRESS = (PROTOCOL = TCP) (HOST = oracle) (PORT=1521))

  #### 7.5.1.1 System ID

  If you want to add a system identifier (SID) name of PLSExtProc and a program name of `EXTPROC` in the server's `listener.ora` file, insert the following in the `SID_LIST_LISTENER` definition:

      SID_LIST_LISTENER =
        (SID_LIST =
        (SID_DESC = ...

        (SID_DESC =
        (SID_NAME=PLSExtProc)(ORACLE_HOME=/oracle/db/dev118)
        (PROGRAM=extproc)

      Notes:

      EXTPROCO and PRESENTATION=RO ends with the letter "o" not the number zero.

      SID=PLSExtProc is non-negotiable.

  ### 7.5.2 tnsnames.ora

  Add the following lines to the end of your `tnsnames.ora` file, to add a net service name description entry for `EXTPROC0` in the server's `tnsnames.ora` file, using `SID` rather than `SERVICE_NAME` in the `CONNECT_DATA` section. For example:

                extproc_connection_data =
                   (DESCRIPTION=
                      (ADDRESS_LIST =
                         (ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC0))
                      )
                      (CONNECT_DATA=
                         (SID=PLSExtProc)
                         (PRESENTATION = RO)
                      )
                   )

  Notes: Do not substitute your SID anywhere. Do not change the case of any text. EXTPROCO ends with the letter "o" not the number zero. Start the Net8 Assistant to help you configure the `tnsnames.ora`. See also "Net8 Administrator's Guide" for more information about creating these configuration files.

  ## 7.6 Multilingual Functionality (Multilexer)

  Note: You may need to increase your tablespace to at least 20 MB to support multilexer.

  Oracle8i (8.1.6 and above) provides multilexer which allows you to use language-specific features on documents of different languages stored in the same table. Multilexer is a feature of the index and is configured during index creation. Multilexer requires an extra column in your table, which identifies the language of each document.

  At query time, the multilexer chooses a language-specific lexer to lex the query tokens. This is based on the NLS_LANG setting for the query session. Thus, a query session in the FRENCH language uses the lexer for FRENCH.

  During installation of Oracle Portal, the `sbrimtlx.sql` script creates the language-specific lexer preferences and gathers them under a single multilexer preference.

  ## 7.7 interMedia Text-related Procedures Created in Oracle Portal

  The Oracle Portal installation creates the following procedures in the `ctxsys` schema. These procedures are created to support the user datastores that are used in Oracle Portal content areas for interMedia Text indexing.

  - `WWSBR_CORNER_CTX_<``n``>`

  - `WWSBR_DOC_CTX_<``n``>`

  - `WWSBR_PERSP_CTX_<``n``>`

  - `WWSBR_THING_CTX_<``n``>`

  - `WWSBR_TOPIC_CTX_<``n``>`

  where <n> is the `user_id` of the Oracle Portal schema which may be different for each database. This value is the `user_id` column value from `all_users`.

| Copyright © 2001 Oracle Corporation. All Rights Reserved. |
Library | Service | Contents | Index