adj (adjacency operator)
The adj operator is used to retrieve documents that contain two words appearing in a specified order and within a specified distance from each other.
The adj operator is specified with the <adj>
element. The VALUE
attribute lets you specify the maximum distance, in number of words, between the search
words. The order of the search words is determined by the order they are specified
within the <adj> element.
This sample query retrieves documents that contain the words children and toys if the words appear in that order, and if the two words are separated by at most 5 words. For example, it would retrieve a document containing the sentence "Children need good toys".
<?xml version="1.0" encoding="UTF-16"?>
<!-- adjQuery.xml -->
<query VERSION="4.5" RESULTSPACE="adjQuery">
<key NAME="FullText">
<adj VALUE="5">
<elem>children</elem>
<elem>toys</elem>
</adj>
</key>
</query>
All sample queries are located in your Program Files directory for TEXTML Server: [...]\IxiaSoft\TextmlServer[version]\SDK\Queries\*.xml.