Search fields in databases and document properties associated with files
To limit a search request to a particular field in a document, use the following syntax:
FieldName contains ( search request )
Example:
City contains (portland or Seattle)
Field searches can be combined using boolean operators, like this:
(City contains (portland or Seattle)) and (Address contains (Washington))
The parenthesis are necessary to ensure that dtSearch interprets the search request correctly.
An alternative syntax for field searches is to add the field name and :: in front of each word, like this:
(City::Portland or City::Seattle) and (Address::Washington)
The alternative syntax can be used where the boolean syntax is not possible, such as in "all words" or "any words" searches and file conditions.
Some file formats such as XML support nesting of fields. Example:
<record>
<name>John Smith</name>
<address>
<street>123 Oak Street</street>
<city>Middleton</city>
...
In dtSearch, a search of a field includes any fields that are nested inside of the field, so the XML file above would be retrieved in a search for any of the following:
record contains oak address contains oak street contains oak
To specify a specific subfield of a field, use / to separate the field names, like this:
record/address contains oak address/street contains oak record/address/street contains oak
Put a / at the front of the field name to specify that it cannot be a sub-field of another field:
/record/name contains Smith /name contains Smith
The second search request above would not match the XML example because, while it contains a "name" field, the name field is a sub-field of the record-field. A search for /name specifies a "name" field at the top of the field hierarchy.
Use // to specify any number of unspecified intervening fields, like this:
/record//city contains Middleton
To search for text that is not in any field, search for //text contains (search request). The //text field name means "not in any field".
|
Copyright (c) 1995-2008 dtSearch Corp. All rights reserved.
|