Foxit PDF SDK
FSDK.FullTextSearch Class Reference

Public Member Functions

 IsEmpty ()
 Check whether current object is empty or not. More...
 
 SearchOf (match_string, rank_mode, callback)
 Search for specified text among the indexed PDF files. More...
 
 SetDataBasePath (path_of_data_base)
 Set a file path as sqlite data base which is used for storing the indexed data. More...
 
 StartUpdateIndex (source, pause, reupdate)
 Start to update the index of PDF files defined in a documents source object. More...
 
 UpdateIndexWithFilePath (file_path)
 Update the index result of a specified PDF file. More...
 

Static Public Attributes

static e_RankNone: number static e_RankHitCountASC: number static e_RankHitCountDESC: number constructor()
 Enumeration for rank mode of full text search. More...
 

Detailed Description

This class is used to index some PDF files and then search specified text among these indexed PDF files.

Member Function Documentation

◆ IsEmpty()

FSDK.FullTextSearch.IsEmpty ( )

Check whether current object is empty or not.

When the current object is empty, that means current object is useless.

Returns
true means current object is empty, while false means not.

◆ SearchOf()

FSDK.FullTextSearch.SearchOf ( match_string  ,
rank_mode  ,
callback   
)

Search for specified text among the indexed PDF files.

This function can be used to search among several PDF files, which have been indexed by function FSDK.FullTextSearch.StartUpdateIndex or FSDK.FullTextSearch.UpdateIndexWithFilePath. The searching result will be returned through callback function FSDK.SearchCallback.RetrieveSearchResult, in specified ranking mode.

Parameters
[in]match_stringA string to be searched. It should not be an empty string and should be UTF-8 encoding.
[in]rank_modeThe ranking mode used for searching results. Please refer to values starting from FSDK.FullTextSearch.e_RankNone and this should be one of these values.
[in]callbackA FSDK.SearchCallback object. It should not be null. User should implement it and use it to retrieve the searching results.
Returns
true means success, while false means failure.

◆ SetDataBasePath()

FSDK.FullTextSearch.SetDataBasePath ( path_of_data_base  )

Set a file path as sqlite data base which is used for storing the indexed data.

This function is only useful before updating the index of PDF files for the first time by function FSDK.FullTextSearch.StartUpdateIndex or FSDK.FullTextSearch.UpdateIndexWithFilePath. Once the updating has been done, this function will be useless.
If this function has never called for current full text search object successfully, the default file for sqlite data would be named as "fts.db" and located with application file.

Parameters
[in]path_of_data_baseA file path to specify a file as sqlite data base. It should not be an empty string and should be UTF-8 encoding.
Returns
None.

◆ StartUpdateIndex()

FSDK.FullTextSearch.StartUpdateIndex ( source  ,
pause  ,
reupdate   
)

Start to update the index of PDF files defined in a documents source object.

It may take a long time to do this updating, so Foxit PDF SDK uses a progressive process to do this.
Only PDF files under the specified directory (including sub-directory) defined in documents source can be indexed. The index of PDF files in the database that are not located in the specified directory (including sub-directory) defined in the document source will be deleted.

Parameters
[in]sourceA documents source object, which defines a directory to be indexed.
[in]pausePause callback object which decides if the updating process needs to be paused. This can be null which means not to pause during the updating process. If this is not null, it should be a valid pause object implemented by user. Default value: null.
[in]reupdatetrue means to re-update the existing index information in the database, and false means not to re-update the existing index information in the database. Default value: false.
Returns
A progressive object. Please check the rate of current progress by function FSDK.Progressive.GetRateOfProgress. If the rate is not 100 yet, call function FSDK.Progressive.Continue to continue the progress until the progress is finished.

◆ UpdateIndexWithFilePath()

FSDK.FullTextSearch.UpdateIndexWithFilePath ( file_path  )

Update the index result of a specified PDF file.

This function can be used to update the index result of a single PDF file.

Parameters
[in]file_pathAn existed PDF file path. It should not be an empty string and should be UTF-8 encoding.
Returns
true means success, while false means failure.

Member Data Documentation

◆ e_RankNone

FSDK.FullTextSearch.e_RankNone
static

Enumeration for rank mode of full text search.

Values of this enumeration should be used alone.

No ranking mode is used for searching results.