11
Search and Index Essentials
Searching for Text in PDF Documents
●
●
MatchPhrase
: match the exact phrase
MatchAllWords
: match all the words without regard to the order in which they
appear
●
●
MatchAnyWord
: match any of the words in the search string
BooleanQuery
: perform a boolean query for multiple-document searches (the
default)
For example, the following code matches the phrases
"My Search"
or
"Search My"
:
search.wordMatching = "MatchAllWords";
search.query("My Search");
To determine whether proximity is used in searches involving multiple documents or index
definition files, set the
search
object’s
wordMatching
property to
MatchAllWords
and set its
proximity
property to
true
. In the example below, all instances of the words
My
and
Search
that are not separated by more than 900 words will be listed in the search:
search.wordMatching = "MatchAllWords";
search.proximity = true;
search.query("My Search");
To use stemming in the search, set the
search
object’s
stem
property to
true
. For
example, the following search lists words that begin with "run", such as "running" or "runs":
search.stem = true;
search.query("run");
194
Acrobat JavaScript Scripting Guide