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 <#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
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
maxDocs
unlimited
. unlimited
means
that as many hits are to be included in the results list as the
platform supports.offset
start
length
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
query
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
sortOrder
score
,
i. e. by relevance. The element must have at least one and can
have up to 16 sortField
subelements:
sortField
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
id
,
title
, and score
are returned.
Subelements:
resultField
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
: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.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.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
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.