Search requests are formed using the ses-search element in
an ses-request element. Example:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ses-payload SYSTEM "https://www.infopark.com/ses.dtd">
<ses-payload payload-id="B42TE241" timestamp="20100825172100" ses.version="2.0">
<ses-header>
<ses-sender sender-id="FX45RTDT" name="CM-Server"/>
<ses-authentication login="cm-server" password=""/>
</ses-header>
<ses-request request-id="BR12TI5X">
<ses-search>
<query parser="simple">www <#AND> business</query>
<minRelevance>50</minRelevance>
<maxDocs>200</maxDocs>
<offset>
<start>61</start>
<length>20</length>
</offset>
<searchBase>
<query parser="simple">title <#CONTAINS> business</query>
<collection>collection1</collection>
<collection>collection2</collection>
</searchBase>
<sortOrder>
<sortField direction="desc">field23</sortField>
...
</sortOrder>
<resultRecord>
<resultField format="ISO" timezone="MEZ"
formatter="formatterAliasName">field1</resultField>
...
</resultRecord>
<searchDirection start="newest" />
</ses-search>
</ses-request>
</ses-payload>
In the following, the subelements of the ses-search element
are described. If left out in the request, the defaults specified here,
such as 500 for maxDocs (the maximum number of
documents in the search result), are filled in by the Search Engine Server,
before the request is passed to the search engine module. This is only the
case if the Verity search engine module is used. The preprocessor, however,
always receives the original request document to which no default values
have been added.
query
This element is optional. It has the optionalparserattribute whose value can besimple(the default),explicit, orfreetext. If the element is not specified, all indexed documents of the specified collection are returned. The content of the element is the search query, stated in the search processor’s syntax.minRelevance
This optional element is used to specify the minimum relevance of the documents to be included in the search result. Valid values are integer numbers in the range from 0 to 100 (inclusive), with 0 indicating the least and 100 the most relevant documents. The default value is 0.maxDocs
This element is optional. Its content specifies the maximum number of documents to be included in the results list. Valid values are positive integer numbers and the character stringunlimited.unlimitedmeans that as many hits are to be included in the results list as the platform supports.offset
This optional element allows you to define the subset of the search result to be returned. Subelements:start
The content of this element specifies the index of the first document to be returned. The index of the first document in the search result is 1. Default: 1.length
specifies the number of documents to return, starting with the document whose index is defined bystart. Default: 20. Ifoffsetspecifies a partly or completely nonexistent subset of the search result, no documents, or only those documents present in the range, respectively, are returned. In these cases, no error message is generated.
searchBase
This optional element restricts the documents to search by a search query or a list of collections. If the element is not present, all indexed documents in all collections are searched. Subelements:query
This element is optional. It specifies a search which is performed before the query given in thequeryelement belowses-searchis executed. If the element is not present, all indexed documents in the specified collections are searched. The element has the optionalparserattribute, whose value can besimple(the default),explicit, orfreetext. The content of the element is the search query stated in the search processor’s syntax.collection
This element is optional and can be specified more than once. Its content is the name of a collection whose documents are to be searched. If the element has not been specified, all the documents of all collections are searched.
sortOrder
This optional element can be used to determine the criteria by which the documents in the search result are sorted. By default, the documents are sorted byscore, i. e. by relevance. The element must have at least one and can have up to 16sortFieldsubelements:sortField
EachsortFieldelement determines the name of a document field to be used as sorting criterion, taking into account the order of the elements. The firstsortFieldelement defines the primary sorting criterion, the second element the second criterion and so forth. Of each field value only the first 64 characters are taken into account. All available fields plusscorecan be specified as sorting criterion.sortFieldhas the optionaldirectionattribute which specifes the sort order. Valid values areasc(ascending, the default) anddesc(descending).
resultRecord
This element is optional. Its subelements specify the fields to be returned for each document in the search result. By default the fieldsid,title, andscoreare returned. Subelements:resultField
The contents of aresultFieldelement specifies the name of the field to be returned for each document. The content ofresultRecordmay contain severalresultFieldelements. All available fields as well asidandscorecan be specified. If a nonexistent field is specified, then the empty value is returned as its value. The element has the three attributesformat,timezoneandformatter:
The value offormatis the name of a date format used to format the field values concerned, provided they are date values. The format names and its formats are stored in thevalidDateTimeOutputFormatssystem configuration entry (see Executing the Search Engine Server). By default, the first format specified there is used.
Thetimezoneattribute can be used to specify the timezone into which date specifications are to be converted. By default the timezone of the server on which the Search Engine Server is running is used.
Using theformatterattribute the values of the document fields returned can be formatted independently of their type. The value of the attribute is the alias name of a Tcl procedure. To this alias the true Tcl procedure name must have been assigned in thetclFormatterCommandssystem configuration entry (see Executing the Search Engine Server).
searchDirection
This optional element defines the order in which the documents in the specified collections are searched. This order is determined with thestartattribute. Its value can benewest(the default) oroldest.newestcauses the search to start with the most recent documents. Otherwise it starts with the oldest documents. The element does not have any content.