unit (advanced conjunction operator)
The unit operator retrieves documents that contain all specified words within the same XML unit.
Note: To use this query, you must first
create a unit definition for the docbase being searched. For information on units, see
.
The unit operator is specified with the
<unit>
element:
- Search terms are defined as children of
<unit>
. - The
NAME
attribute lets you specify the name of the unit within which the words must be found. - The unit must be defined in the Index Definition document.
This sample query retrieves documents that contain the words Paris and spring, providing that both words
are within the same paragraph (the <p>
element in
this case having previously been defined as a unit named Paragraphs
). If you had defined a Sentence unit instead of a Paragraphs unit,
this query would find the same values only where they appear within the same sentence.
Note: The Index Definition document (indexdefinition.xml) distributed with the TEXTML Server does not define any units. If you run this query without modifying the
indexdefinition.xml file, the query will fail with
the following error message: "Paragraphs is not a valid unit".
<?xml version="1.0" encoding="utf-16"?>
<!-- unitQuery.xml -->
<query VERSION="4.5" RESULTSPACE="unitQuery">
<key NAME="FullText">
<unit NAME="Paragraphs">
<elem>Paris</elem>
<elem>spring</elem>
</unit>
</key>
</query>