Home

 

Set the default dictionary

Use administrative commands to set the default dictionary used for search query strings.

When using administrative commands, use the IBM WebSphere Application Server wsadmin client. See Start wsadmin for details.


You use the setDefaultDictionary command to set the default dictionary used for search queries. The default dictionary is used when guessing the intended language of the search query string. If the query string is not clearly identifiable as belonging to a specific language, then the default language is used.

At indexing time, when content is analyzed, an attempt is made to guess which of the enabled IBM LanguageWare dictionaries should be used when applying the text analysis process. If the attempt is unsuccessful or if the language guessed does not have a corresponding dictionary enabled, the default dictionary is used.

The default dictionary is also used at search time. Language guessing is not used at search time to determine which dictionary is used for text analysis, the language is specified as part of the HTTP request. If there is a problem loading the dictionary corresponding to the language specified or if there is no corresponding dictionary enabled, then the default dictionary is used.

To specify a default dictionary for use with search...

  1. Start wsadmin so that you can access the search configuration file.

  2. After the wsadmin command environment has initialized, use one of the following commands to initialize the search environment and start the search script interpreter:

    When asked to select a server, you can select any server.

  3. Check out the search cell-level configuration file...

    SearchCellConfig.checkOutConfig("<working_dir>", "<cellName>")

    where:

    • <working_dir> is the temporary to which you want to check out the cell level configuration file. This must exist on the server where you are running wsadmin.

    • <cellName> is the name of the cell that the search node belongs to. This argument is required even in stand-alone deployments. This argument is also case-sensitive, so type it with care. If you do not know the cell name, do one of the following to determine it:

      • Stand-alone deployment: Look at the name after the following in the file system:

        WAS_HOME\profiles\profile_name\config\cells\

      • Network deployment: From wsadmin...

        print AdminControl.getCell()

    For example:

      SearchCellConfig.checkOutConfig("c:/search_temp", "SearchServerNode01Cell")
      

  4. To set the default dictionary...

      SearchCellConfig.setDefaultDictionary(String languageCode)
      

    where:

    • languageCode is the language code for the dictionary that you want to set as the default.

      This language code typically comprises two letters conforming to the ISO standard 639-1:2002 that identifies the primary language of the dictionary. However, there are some codes that additionally define a country or variant, in which case these constituent parts are separated by a hyphen. For example, Portuguese has two variants, one for Portugal (pt) and one for Brazil (pt-BR).

    A matching dictionary must exist in the list of configured dictionaries for the language that you specify as a parameter. For example:

      SearchCellConfig.setDefaultDictionary("fr")
      

  5. Check in the changed configuration property keys using the following wsadmin client command:

    SearchCellConfig.checkInConfig()

  6. To exit wsadmin, type

    exit

    at the prompt.

  7. Stop the server or servers hosting the search feature, delete the index, and then restart the search servers. The next time the scheduled task fires, it recreates the index.


Configure dictionaries for search

 

Related tasks

Apply property changes

 

Related reference


SearchCellConfig commands


+

Search Tips   |   Advanced Search