The Adobe Acrobat Search plug-in allows users to perform text searches in PDF documents. It adds menus,
menu items, toolbar button, and a Search panel to the Acrobat viewer.
The Search plug-in exports a Host Function Table (HFT) containing several methods that can
be used by other plug-ins.
The HFT's name is Search
, and its version number
is 0
. To use the Search plug-in's HFT, a
plug-in must include the header file SrchClls.h
. The plug-in must also import
the HFT using ASExtensionMgrGetHFT() and assign the HFT returned by this call to a plug-in-defined
global variable named gSearchHFT
.
Acrobat 6.0 and later has two versions of the Search plug-in, Search
(new in Acrobat 6.0) and Search5
(also available in Acrobat 5.0).
-
The
Search
plug-in uses a search engine licensed from Lextek
International. Lextek can be contacted at http://www.lextek.com.
-
The
Search5
plug-in uses a search engine licensed from
Verity, Inc. Verity can be contacted at http://www.verity.com.
You can do the following with either version of the Search plug-in:
- Create or delete indexes.
- Ask what indexes are available.
- Send queries to an existing index.
You cannot use either version of the Search plug-in to directly obtain the results of a
search, for manipulation or for display in an application other than Adobe Acrobat.
Search supports interapplication communication (IAC) in the form of DDE messages on Windows and Apple events on
Mac OS. These DDE messages and Apple events allow remote clients to submit search queries and
manipulate a list of indexes (the list of indexes is referred to as the shelf).
This document describes the Search HFT. The Interapplication Communication (IAC) APIs
supported by the Acrobat Search plug-in are described
in Developing Applications using Interapplication Communication
and the Interapplication Communication API Reference.
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
#define Init_SearchHFT ASExtensionMgrGetHFT(ASAtomFromString(SearchHFT_NAME), SearchHFT_LATEST_VERSION)
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
#define kSearchBookmarks 0x00000002L
File: SrchType.h |
Line: 90 |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
#define kSearchDocInfo 0x00000020L
File: SrchType.h |
Line: 106 |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
#define kSearchDocumentText 0x00000001L
File: SrchType.h |
Line: 86 |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
#define kSearchDocumentXMP 0x00000008L
File: SrchType.h |
Line: 98 |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
#define kSearchEveryWhere ASMAXUns32
File: SrchType.h |
Line: 128 |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
#define kSearchJPEGExif 0x00000040L
File: SrchType.h |
Line: 110 |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
#define kSearchMarkup 0x00000004L
File: SrchType.h |
Line: 94 |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
#define kSearchPDFAttachments 0x00000100L
File: SrchType.h |
Line: 124 |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
#define kSearchSignatures 0x00000010L
File: SrchType.h |
Line: 102 |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
#define kSearchUserProperties 0x00000080L
DescriptionBy including the kSearchUserProperties option, you will ensure that the object level data is the same as that seen by the menu item Object Data Tool in Acrobat. This is not the metadata associated with individual COS level objects in the PDF document.
File: SrchType.h |
Line: 120 |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
#define SearchHFT_LATEST_VERSION (0L)
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
#define SearchHFT_NAME "Search"
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
#define SearchNUMSELECTORS (SearchNUMSELECTORSplusOne - 1)
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
typedef void* SearchIndexListPtr;
File: SrchType.h |
Line: 206 |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
typedef void* SearchIndexPtr;
File: SrchType.h |
Line: 208 |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
File: SrchType.h |
Line: 201 |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
File: SrchType.h |
Line: 133 |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
The client must supply all the search word options in the scope parameter by doing an OR
(|
) operation on all options where the search needs to be executed. For example, if the client needs to search on attachments, and within attachments the search needs to be done on document text and XMP data, then it can be specified as follows:
scope = kSearchDocumentText | kSearchDocumentXMP | kSearchPDFAttachments;
In most cases, however, the client might want to search on all the places possible, so it would suffice to write:
scope = kSearchEveryWhere;
File: SrchType.h |
Line: 82 |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
enum _SearchSelector {
| SearchBAD_SELECTOR, |
|
| SearchNUMSELECTORSplusOne = (char *cQuery, ASInt16 nParserID, ASUns16 nSortCount, char **cSortNames, ASBool *bSortWays, ASUns32 nWordOptions, ASBool bOverrideWordOptions, ASUns16 nMaxDocs)(void)(SearchIndexListPtr list)(SearchIndexListPtr list, ASUns32 n)(SearchIndexListPtr list, char *fullPath)(SearchIndexListPtr list, char *fullPath, ASUns32 flags)(SearchIndexListPtr list, SearchIndexPtr index)(SearchIndexPtr index)(SearchIndexPtr index, ASUns32 flags)(SearchIndexPtr index)(SearchIndexPtr index)(SearchIndexListPtr list, ASFileSys fileSys, ASPathName indexPath)(SearchIndexListPtr list, ASFileSys fileSys, ASPathName indexPath, ASUns32 flags)(SearchIndexPtr index)(SearchIndexPtr index)(SearchIndexPtr index)(void)(const SearchQueryDataRec *queryData) |
}
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
enum SearchMatchOption {
| kMatchPhrase, |
|
| kMatchAllWords, |
|
| kMatchAnyWords, |
|
| kBooleanQuery |
}
File: SrchType.h |
Line: 150 |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
enum SearchType {
| kSearchActiveDoc, |
|
| kSearchFolder, |
|
| kSearchIndex, |
|
| kSearchActiveIndexes |
}
File: SrchType.h |
Line: 137 |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
HFT gSearchHFT;
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
struct _t_SearchQueryDataRec {}
File: SrchType.h |
Line: 162 |
Elements
| size | The size of the data structure. It must be set to sizeof(SearchQueryDataRec) . |
|
| query | The text to be searched. |
|
| type | The location to search in. |
|
| match | How the query text should be matched in the document. |
|
| options | The search options. |
|
| scope | The content in the PDFs that should be searched. It should be an OR of values specified in SearchScope. |
|
| path | The path of the folder or index. It is required only when type is kSearchFolder or kSearchIndex. |
|
| fs | The ASFileSys of the folder or index. It is required only when type is kSearchFolder or kSearchIndex. |
|
| maxDocs | The maximum number of documents to display in the Results window. If more documents than this have hits, only the first maxDocs are displayed. maxDocs must be no greater than 999 . |
|
| startPage | The page number to start the search; 0 is the first page. |
|
| proximityRange | The range of words for proximity searches. |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
Superseded in Acrobat 6.0 by SearchAddIndexEx().
Adds a specified index to the shelf.
Parameters
| list — | The list of indices on the shelf, obtained using SearchGetIndexList(). |
|
| fullPath — | A platform-dependent path to the index. |
|
| flags — | A platform-dependent path to the index:
-
On Mac OS, it is of the form MyDisk:TopFolder:BottomFolder:Strange.pdx .
-
On Windows, it is of the form C:\LVL1\MYFILES\INDEX . On UNIX and Windows, the .PDX extension is automatically added to the specified path name.
|
Returns
File: SrchPrcs.h |
Line: 175 |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
Supersedes SearchAddIndex() in Acrobat 6.0.
Adds a specified index to the shelf, using the Acrobat 6.0 file system and path mechanism.
Parameters
| list — | The list of indices on the shelf, obtained using SearchGetIndexList(). |
|
| fileSys — | The file system on which the index is found. |
|
| indexPath — | The path to the index. |
|
| flags — | Flags that indicate the state of the index. It must be an OR of the following values (see SrchType.h):
Value
|
Description
|
kIndexAvailableFlag
|
The index is available for searching. Indices that are not available appear grayed out in the Search plug-in's user interface.
|
kIndexSelectedFlag
|
The index is used for searching. Indices that are selected appear with a filled in check box in the Search plug-in's user interface.
|
kIndexPtrInvalidFlag
|
(Read only: cannot be set). The index cannot be located; it does not exist.
|
In practice, kIndexAvailableFlag should always be set. |
Returns
File: SrchPrcs.h |
Line: 294 |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
Gets the number of indices currently on the shelf.
Parameters
Returns
| The number of indices on the shelf. |
File: SrchPrcs.h |
Line: 112 |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
Superseded in Acrobat 6.0 by SearchExecuteQueryEx(), which allows a broader range of search locations.
Executes a specified query, using the set of indices currently on the shelf. The search results are displayed in the Acrobat Search plug-in's Results window.
Parameters
| cQuery — | The query. Its format is the same as what a user would type into the Search query dialog, and depends on the search language specified by parserID . |
|
| nParserID — | The search language used in the query. It must be one of the following values (see SrchType.h):
Value
|
Description
|
kParserSimple
|
Allows only simple phrase searches; it does not allow boolean searching.
|
kParserCQL
|
Allows boolean searches using AND , OR , and NOT , as described in the Acrobat Search plug-in's online help file.
|
|
|
| nSortCount — | The number of entries in the sortSpec list. |
|
| cSortNames — | An array of strings, each specifying a key whose value is used to sort the search results. The first entry is the primary sort key, the second is the secondary sort key, and so forth. Each string may be any field that appears in the index, plus Score (which sorts results by relevance ranking). Some common fields are Title , ModificationDate , CreationDate , and Keywords . |
|
| bSortWays — | An array of boolean values indicating sort order, corresponding to the array of sortSpecs with true meaning ascending and false meaning descending. |
|
| nWordOptions — | Search options. It must be an OR of the following values (see SrchType.h):
Value
|
Description
|
kWordOptionCase
|
The search is case-sensitive.
|
kWordOptionStemming
|
Find not only the specified word, but other words that have the same stem (for example, run and ran have the same stem).
|
kWordOptionProximity
|
Consider the proximity of results when using the AND operator to look for more than one word in a document. Without this option, AND ed terms can be anywhere in a document. Searching for "red" and "blue" , for example, finds a document where "red" is the first word on the first page and "blue" is the last word on the last page. With this option, however, AND ed terms must be within two or three pages of each other to be found. Also, the closer AND ed terms appear together, the higher the relevance ranking of the document that contains them.
|
kWordOptionRefine
|
Do not search the entire list of indices, but only the documents that matched the previous search. This is used to refine the results of the previous search. The manner in which wordOptions is used depends on the value of overrideWordOptions .
|
|
|
| bOverrideWordOptions — | Flag that indicates whether wordOptions is OR ed with the search options set in the user interface, or is used instead of them. If it is 0 , wordOptions is OR ed with the user interface search options, and the resulting value is used. If it is non-zero, wordOptions is used instead of the user interface search options. |
|
| nMaxDocs — | The maximum number of documents to display in the Results window. If more documents than this have hits, only the first maxDocs are displayed. maxDocs must be no greater than 9999 . |
Returns
| true if successful, false otherwise.
|
File: SrchPrcs.h |
Line: 97 |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
Supersedes SearchExecuteQuery() in Acrobat 6.0.
Executes a specified query, using the given set of search parameters. The search results are displayed in the Acrobat Search plug-in's Results window.
Parameters
| queryData — | A pointer to the structure containing the search parameters. |
Returns
| true if successful, false otherwise.
|
See Also
maxDocs The maximum number of documents to
display in the Results
window. If more documents than this have hits, only the first maxDocs are displayed.
maxDocs
must be no greater than
999
.
File: SrchPrcs.h |
Line: 350 |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
Superseded by SearchGetIndexPathEx() in Acrobat 6.0.
Gets the index that has the specified path. The index must already be on the shelf. The index can be passed to other Search plug-in methods to remove it from the shelf, obtain its title, and so forth.
Parameters
| list — | The list of indices on the shelf, obtained using SearchGetIndexList(). |
|
| fullPath — | A platform-dependent path to the index:
-
On Mac OS, it is of the form MyDisk:TopFolder:BottomFolder:Strange.pdx .
-
On Windows, it is of the form C:\LVL1\MYFILES\INDEX . The .PDX extension is automatically added to the specified path name.
|
Returns
File: SrchPrcs.h |
Line: 145 |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
Supersedes SearchGetIndexPath() in Acrobat 6.0.
Gets the index that has the specified path. The index must already be on the shelf. The index can be passed to other Search plug-in methods to remove it from the shelf, obtain its title, and so forth.
Parameters
Returns
File: SrchPrcs.h |
Line: 263 |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
Gets the file system for a specified index as an ASFileSys object.
Parameters
Returns
File: SrchPrcs.h |
Line: 325 |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
Gets the flags for a specified index.
Parameters
Returns
| The flags returned are the actual values set, and may not always be the same as the requested value. It gets a list of the indices currently on the shelf. The list of indices currently on the shelf is returned. This value can subsequently be used by other Search plug-in methods to obtain information about a specific index, the number of indices on the shelf, and so forth. |
File: SrchPrcs.h |
Line: 197 |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
Gets a list of the indices currently on the shelf.
Returns
| The list of indices currently on the shelf. This value can subsequently be used by other Search plug-in methods to obtain information about a specific index, the number of indices on the shelf, and so forth. |
File: SrchPrcs.h |
Line: 105 |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
Superseded in Acrobat 6.0 by SearchGetIndexPathEx().
Gets the platform-dependent path for a specified index.
Parameters
Returns
| A platform-dependent path to the index:
-
On Windows, it is of the form C:\LVL1\MYFILES\INDEX . The .PDX extension is automatically added to the specified path name.
-
On Mac OS, it is of the form MyDisk:TopFolder:BottomFolder:Strange.pdx .
|
File: SrchPrcs.h |
Line: 245 |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
Supersedes SearchGetIndexPath() in Acrobat 6.0.
Gets the path for a specified index as an ASPathName object.
Parameters
Returns
File: SrchPrcs.h |
Line: 316 |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
Superseded in Acrobat 6.0 by SearchGetIndexTitleEx().
Gets the title of a specified index.
Parameters
Returns
File: SrchPrcs.h |
Line: 229 |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
Supersedes SearchGetIndexTitle() in Acrobat 6.0.
Gets the title of a specified index as an ASText object.
Parameters
Returns
File: SrchPrcs.h |
Line: 305 |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
Gets the n
th index on the shelf. The index can be passed to other Search plug-in methods to remove it from the shelf, obtain its title, and so forth.
Parameters
Returns
| The n th index on the shelf. This value may be used in subsequent calls to remove the index, obtain its title, and so forth. |
File: SrchPrcs.h |
Line: 125 |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
ASBool SearchIsLegacySearchAvailable() |
Tests whether the search mechanism (Search5) for previous Acrobat versions (prior to 6.0) is available for the current system. When Search5 is available, you can search indexes from Acrobat 5.0 and earlier.
Returns
| true if legacy searches are available, false otherwise.
|
File: SrchPrcs.h |
Line: 334 |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
Removes the specified index from the shelf.
Parameters
File: SrchPrcs.h |
Line: 182 |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
Sets the flags for a specified index.
Parameters
| index — | The index whose flags are to be set. The index may be obtained using SearchGetIndexByPath(), SearchGetNthIndex(), or SearchAddIndex(). |
|
| flags — | Flags that indicate the status of the index. flags must be an OR of the values (see SrchType.h):
Value
|
Description
|
kIndexAvailableFlag
|
The index is available for searching. Indices that are not available appear grayed out in the Search plug-in's user interface.
|
kIndexSelectedFlag
|
The index is used for searching. Indices that are selected appear with a filled in check box in the Search plug-in's user interface.
|
kIndexPtrInvalidFlag
|
(Read only: cannot be set). The index cannot be located; it does not exist.
|
In practice, kIndexAvailableFlag should always be set. |
Returns
| The flags returned are the actual values set, and may not always be the same as the requested value. |
File: SrchPrcs.h |
Line: 218 |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
Returns
© 2004-2013 Adobe Systems Incorporated. All rights reserved.
Thu Jan 21 2016, 11:19 AM IST