Previous Page: Internationalizing Your Search Solution  Next Page: Understanding Character Set Encodings

Working with Multiple Languages

Customizing your search solution is important only if you wish to allow your users to conduct language-specific searches. You specify the language of a template by inserting a language identifier in the meta tag of your templates or HTML files. The language identifier can also be used in Search Results pages to allow users to quickly recognize the search results that interest them.

NetWare Web Search Server also allows web clients to specify their locale at the time the search query is entered. The default Search page illustrates this feature by auto-detecting a user's locale and selecting the appropriate language from the "Display Languge" dropdown combo-box. This selection sends two parameters to the Web Search Server: language and country. The country parameter is almost always blank. The search engine uses this information to find locale-specific versions of the templates used to return search results.

To specify the language of a template or of any HTML content that gets indexed as part of your collections, you must enter a language identifier within an HTML file's header section. For example, if you wanted to identify a Russian template, you would add the following meta tag:

<meta http-equiv="Content-Language" content="ru">

In some cases, such as Traditional and Simplified Chinese, you will need to use the two-character, upper-case country codes. For example:

<meta http-equiv="Content-Language" content="zh-TW"> <meta http-equiv="Content-Language" content="zh-CN">

The first line of the example indicates the Chinese language (ZH) and the geographic location as Taiwan. The second line of the example indicates the Chinese lanuage (ZH), but specifies China as the geographic loacation.

This combination of language and country codes is called a locale. For more information about locales, refer to Table 12.


Specifying Locales within Template File Names

NetWare Web Search Server consists of three primary servlets: SearchServlet, PrintServlet, and AdminServlet. Each servlet returns information to the Web client using server-side templates. For more information about templates, see Understanding Templates.

After determining a Web client's locale, Web Search attempts to locate a matching search result template. That is, each of the Web Search services will automatically attempt to locate a version of the requested template that most closely matches the Web client's locale.

HINT:  NetWare Web Search is unable to fin locale-specific templates without the two-character language code and the optional two-character country code. See Table 12 for more information about language code syntax.

For example, if a Web client requests to see search results using the ResultListTemplate.html file and the client is a Chinese language user from Taiwan, and the server is Russian, then Web Search will try to find a Chinese-Taiwan version of the template first.

The first locale-specific lookup for the Chinese search user would be ResultListTemplate_zh_TW.html since that exactly matches the client's language and country. The following list illustrates the template names the system would look up in order of priority.

TOOL TIPTemplates are stored on the SYS volume of your NetWare server in /NSEARCH/TEMPLATES.


Table 10. The Order in Which Web Search Examines The Templates to Select a Matching Language for the User

Template Names What Web Search Concludes

1. ResultListTemplate_zh_TW.html

Specific client locale

2. ResultListTemplate_zh.html

Simplified client locale

3. ResultListTemplate.html

Client requested name

4. ResultListTemplate_ru.html

Specific server locale (no simplified versions)

5. ResultListTemplate_en.html

English language version

6. ResultListTemplate.html

Up to the first underscore ( _ )

If this scenario were reversed so that the search client was Russian and the server was Chinese (Taiwan), and the client requested the ResultListTemplate_ja.html template, then the lookup order would follow the order shown in Table 11.


Table 11. The Order in Which Web Search Examines the Templates to Select a Matching Language for the User

Template Names What Web Search Concludes

1. ResultListTemplate_ja_ru.html

Specific client locale (no simplified versions)

2. ResultListTemplate_ja.html

Client requested name

3. ResultListTemplate_ja_zh_TW.html

Specific server locale

4. ResultListTemplate_ja_zh.html

Simplified server locale

5. ResultListTemplate_ja_en.html

English language version

6. ResultListTemplate.html

Up to the first underscore ( _ )

All templates undergo this rigorous lookup system. Once a template is located, it's name is stored and associated with the original client locale so that all subsequent requests for that template from the same locale automatically find the template without performing the same rigorous lookup.

No further lookups are attempted for that combination of client locale and template name until the NetWare Web Search Server is restarted. If all template lookups fail, then an error message is returned to the client performing the search.



  Previous Page: Internationalizing Your Search Solution  Next Page: Understanding Character Set Encodings