11
Search and Index Essentials
Searching for Text in PDF Documents
Searching PDF Index Files
A PDF index file often covers multiple PDF files, and the time required to search an index is
much less than that required to search each of the corresponding individual PDF files.
To search a PDF index, set the
cWhere
parameter in the
search
object’s
query
method
to
Index
. In the following example,
myIndex
is searched for the word "Acrobat":
search.query("Acrobat", "Index", "/C/MyIndex.pdx");
Using Boolean Queries in Multiple Document Searches
Boolean queries may be applied to multiple PDF documents using the following
operations:
●
●
●
●
AND
OR
^
(exclusive or)
NOT
For example, the phrase
"Paris AND France"
used in a search would return all
documents containing both the words
Paris
and
France
.
The phrase
"Paris OR France"
used in a search would return all documents containing
one or both of the words
Paris
and
France
.
The phrase
"Paris ^ France"
used in a search would return all documents containing
exactly one (not both) of the words
Paris
and
France
.
The phrase
"Paris NOT France"
used in a search would return all documents
containing
Paris
that do not contain the word
France
.
In addition, parentheses may be used. For example, the phrase
"one AND (two OR
three)"
would be equivalent to performing two searches: one using the statement
"one
AND two "
, followed by another using the statement
"one AND three"
.
To specify that a boolean query will be used, be sure that the
search
object’s
wordMatching
property is set to
BooleanQuery
(which is the default).
196
Acrobat JavaScript Scripting Guide