Home > Contents > Index >
Template Tag TOC  |   Alpha TOC  |   Tag Family TOC  |   Purpose TOC  |   Annotated TOC  |   Index 

 

SEARCH

Searches an index based on a query.

Syntax

Parameters

INDEX (optional)
Name of the index to search. Default is specified in the Content Server properties file.

WHAT (required)
Query to submit. This should be in the format the given search engine understands and may also depend on the QUERYPARSER value.

LIST (required)
Name of the output list. Columns returned are:

QUERYPARSER (optional for Verity)
The AltaVista search engine supports three search types--Simple, Advanced, and Combined. Advanced is the default, and was previously the only one supported.

The simple search syntax uses optional + or - signs on a word or phrase to indicate that it is required or prohibited in the search results. The Advanced syntax uses Boolean operators (such as and, or, not, near) to constrict complex queries. In both cases, the query is passed in the WHAT parameter. The RELEVANCE parameter is ignored.

The combined syntax uses both types of syntax. A Boolean query is specified by the WHAT parameter and a simple query is specified by the RELEVANCE parameter to determine the ranking order of the results.

The Verity search engine supports three query parsers--Simple, FreeText, and BoolPlus. The optional QUERYPARSER tag tells the Verity search engine the syntax of the WHAT clause. If this argument is omitted, then the Simple parser is used by default. The parser may be specified by the verity.parser property in the futuretense.ini file. The choice of parser determines the syntax and form of the query

RELEVANCE (optional for AltaVista)
Boolean term to be used for computing relevance ranking.

LIMIT (optional)
Maximum number of results to return to the list.

CHARACTERSET (optional)
Constant value representing the character set the index uses.

For the AltaVista search engine this value can be 0, 1, or 2 (ISO_LATIN1, ASCII8, UTF8). If you do not specify CHARACTERSET, Content Server uses the value of av.charset from the Content Server properties file.

Because Java Strings are transformed to UTF8, as they pass through the JNI interface to AltaVista, the 0 value only works for 7-bit ASCII. For all other cases, use the value for UTF8.

For the Verity search engine, this value specifies the name of the subdirectory of the common directory where the locale is defined. If you do not specify CHARACTERSET, Content Server uses the value of verity.charset in the Content Server properties file.

SEARCHENGINE (optional)
Name of the search engine to use. If SEARCHENGINE is not specified, Content Server uses the value of cs.searchengine from the Content Server properties file.

Description

The SEARCH tag searches an index based on a query. The resultset of the query is stored in a list.

errno

The possible values of errno include:

Value
Description
-101
No search results.
-800
Bad search type.
-801
Cannot load search engine.
-802
Unsupported search function.
-805
No default index specified.
-806
Unknown search engine.
-809
Search failed.
-810
Bad character set.
-811
Could not call native method.
-812
Index does not exist.

Example

This example searches the existing index in c:ArticleIndex for headlines with the name Clinton in them. If any are found, then the search result list is looped over and the headline and the author are displayed. Since this information is not directly available from the index, the ENTRY field of the search result list is used to lookup the article entry in the appropriate database table and the required fields are obtained from the database record for the article.

Note

This example requires that the database be accessed for each article. This can be inefficient, especially in those cases where the search results are to be displayed only so that the one element required may be selected for further use. In this case, you should use the DETAIL field of the search result list. When entries are added to the index, you should set the DETAIL parameter to some useful text string. For this example, it could be set to the article title so that you can then display and use it to select the article of interest.

See Also

INDEXCREATE

  Home > Contents > Index >

FatWire XML Tag Reference
Copyright 2005 by FatWire Software
All rights reserved.