Request

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 "http://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 &lt;#AND&gt; business</query>
      <minRelevance>50</minRelevance>
      <maxDocs>200</maxDocs>
      <offset>
        <start>61</start>
        <length>20</length>
      </offset>
      <searchBase>
        <query parser="simple">title &lt;#CONTAINS&gt; 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 optional parser attribute whose value can be simple (the default), explicit, or freetext. 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 string unlimited. unlimited means 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 by start . Default: 20. If offset specifies 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 the query element below ses-search is executed. If the element is not present, all indexed documents in the specified collections are searched. The element has the optional parser attribute, whose value can be simple (the default), explicit, or freetext. 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 by score, i. e. by relevance. The element must have at least one and can have up to 16 sortField subelements:
    • sortField
      Each sortField element determines the name of a document field to be used as sorting criterion, taking into account the order of the elements. The first sortField element 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 plus score can be specified as sorting criterion. sortField has the optional direction attribute which specifes the sort order. Valid values are asc (ascending, the default) and desc (descending).
  • resultRecord
    This element is optional. Its subelements specify the fields to be returned for each document in the search result. By default the fields id, title, and score are returned. Subelements:
    • resultField
      The contents of a resultField element specifies the name of the field to be returned for each document. The content of resultRecord may contain several resultField elements. All available fields as well as id and score can be specified. If a nonexistent field is specified, then the empty value is returned as its value. The element has the three attributes format, timezone and formatter:
      The value of format is 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 the validDateTimeOutputFormats system configuration entry (see Executing the Search Engine Server). By default, the first format specified there is used.
      The timezone attribute 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 the formatter attribute 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 the tclFormatterCommands system 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 the start attribute. Its value can be newest (the default) or oldest. newest causes the search to start with the most recent documents. Otherwise it starts with the oldest documents. The element does not have any content.