FieldText Query Guidelines
-
In addition to document fields, you can also apply FieldText restrictions to metafields, such as
autn_date
,autn_database
,autn_section
,autn_langtype
, andautn_language
. For example:FieldText=STRING{Archiv}:autn_database
In this example, the
autn_database
metafield must contain the substring Archiv for this document to return. For example, if theautn_database
metafield has the value Archive or Archives, this document returns.FieldText=WILD{eng*}:autn_langtype
In this example, the
autn_langtype
metafield must contain a value that starts with eng (for example, englishASCII or English_UTF8) for this document to return as a result. -
You can use multiple field specifiers simultaneously by combining them with the Boolean operators
AND
,NOT
, andOR
. For example:FieldText=GREATER{6.95}:PRICE:PREIS+AND+MATCH{Brown}:AUTHOR:AUTOR
In this example, the
PRICE
orPREIS
field must contain a number greater than 6.95, and theAUTHOR
orAUTOR
field must have the value Brown, for the document to return as a result.FieldText=(LESS{10}:PRICE+AND+MATCH{Penguin}:PUBLISHER)+OR+(NRANGE{20,30}:PRICE+AND+MATCH{George Orwell}:AUTHOR)
In this example, the documents must meet one of these two criteria:
-
the
PRICE
field contains a number smaller than 10, and itsPUBLISHER
field has the value Penguin. -
the
PRICE
field contains a number between 20 and 30, and itsAUTHOR
field has the value George Orwell.
-
-
You can use the proximity operators
BEFORE
andAFTER
to specify the order in which certain fields must occur in a document. For example:FieldText=MATCH{Penguin}:PUBLISHER BEFORE MATCH{George Orwell}:AUTHOR
This example returns only documents where the
PUBLISHER
field contains the value Penguin earlier in the document than theAUTHOR
field that contains the value George Orwell.NOTE: For a FieldText query to successfully compare two occurrences of the same field, you must set the XMLFullStructure configuration parameter to
True
in the[Server]
section of the configuration file.FieldText=MATCH{George Orwell}:AUTHOR AFTER MATCH{Thomas Brown}:AUTHOR
This example returns only documents where one occurrence of the
AUTHOR
field contains the value George Orwell later in the document than another occurrence of theAUTHOR
field that contains the value Thomas Brown. This query returns results only if you have set XMLFullStructure toTrue
. -
To identify the fields, use the format
/FieldName
to match root-level fields,*/FieldName
to match all fields except root-level, or/Path/FieldName
to match fields that the specified path points to.To identify XML attributes, use the format
<tag name>/_ATTR_<attribute name>
, for example,FARM/_ATTR_ANIMAL
. You can also use Wildcards when identifying fields, for example,/Fi*d1
or/Field*
. -
All string matching is case insensitive, unless you set the CaseSensitive parameter to
True
(this parameter does not apply forTERM
,TERMPHRASE
, andTERMALL
, which are always case insensitive).Strings can contain punctuation, except braces ({ }). You must percent-encode ampersands (
&
) in strings as%26
. To distinguish commas within strings from separator commas, percent-encode commas twice within strings (%252C
).You must not percent-encode commas that separate multiple items, and braces that start and end lists.
For example, to match the two strings
hello,world
andgoodbye,again
:FieldText=MATCH{hello%252Cworld,goodbye%252Cagain}:FIELD