com.foxit.sdk.fts.FullTextSearch Class Reference
Inheritance diagram for com.foxit.sdk.fts.FullTextSearch:
com.foxit.sdk.common.Base

Classes

enum  RankMode
 Enumeration for ranking mode used for searching results.
More...
 

Public Member Functions

 FullTextSearch ()
 Constructor.

 
 FullTextSearch (FullTextSearch other)
 Constructor, with another FullTextSearch object. More...
 
boolean isEmpty ()
 Check whether current object is empty or not. More...
 
boolean searchOf (String match_string, FullTextSearch.RankMode rank_mode, SearchCallback callback) throws com.foxit.sdk.PDFException
 Search for specified text among the indexed PDF files. More...
 
void setDataBasePath (String path_of_data_base) throws com.foxit.sdk.PDFException
 Set a file path as sqlite data base which is used for storing the indexed data. More...
 
Progressive startUpdateIndex (DocumentsSource source, PauseCallback pause, boolean reupdate) throws com.foxit.sdk.PDFException
 Start to update the index of PDF files defined in a DocumentsSource object. More...
 
boolean updateIndexWithFilePath (String file_path) throws com.foxit.sdk.PDFException
 Update the index result of a specified PDF file. More...
 

Detailed Description

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

Constructor & Destructor Documentation

◆ FullTextSearch()

com.foxit.sdk.fts.FullTextSearch.FullTextSearch ( FullTextSearch  other)

Constructor, with another FullTextSearch object.

Parameters
otherAnother FullTextSearch object.

Member Function Documentation

◆ isEmpty()

boolean com.foxit.sdk.fts.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()

boolean com.foxit.sdk.fts.FullTextSearch.searchOf ( String  match_string,
FullTextSearch.RankMode  rank_mode,
SearchCallback  callback 
) throws com.foxit.sdk.PDFException

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 FullTextSearch::startUpdateIndex or FullTextSearch::updateIndexWithFilePath. The searching result will be returned through callback function SearchCallback::retrieveSearchResult, in specified ranking mode.

Parameters
match_stringA string to be searched. It should not be an empty string.
rank_modeThe ranking mode used for searching results. Please refer to values starting from e_RankNone and this should be one of these values.
callbackA 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()

void com.foxit.sdk.fts.FullTextSearch.setDataBasePath ( String  path_of_data_base) throws com.foxit.sdk.PDFException

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 FullTextSearch::startUpdateIndex or FullTextSearch::updateIndexWithFilePath. Once the updating has been done, this function will be useless.
If this function has never called for current FullTextSearch object successfully, the default file for sqlite data would be named as "fts.db" and located with application file.

Parameters
path_of_data_baseA file path to specify a file as sqlite data base. It should not be an empty string.
Returns
None.

◆ startUpdateIndex()

Progressive com.foxit.sdk.fts.FullTextSearch.startUpdateIndex ( DocumentsSource  source,
PauseCallback  pause,
boolean  reupdate 
) throws com.foxit.sdk.PDFException

Start to update the index of PDF files defined in a DocumentsSource 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 DocumentsSource can be indexed.

Parameters
sourceA DocumentsSource object, which defines a directory to be indexed.
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.
reupdatetrue means to re-update the indexes, and false means not to re-update the indexes.
Returns
A Progressive object. Please check the rate of current progress by function common::Progressive::getRateOfProgress. If the rate is not 100 yet, call function common::Progressive::resume to coninue the progress until the progress is finished.

◆ updateIndexWithFilePath()

boolean com.foxit.sdk.fts.FullTextSearch.updateIndexWithFilePath ( String  file_path) throws com.foxit.sdk.PDFException

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
file_pathAn existed PDF file path. It should not be an empty string.
Returns
true means success, while false means failure.

Foxit Software Corporation Logo
@2018 Foxit Software Incorporated. All rights reserved.