Public Types | |
enum | RankMode { e_RankNone = 0, e_RankHitCountASC = 1, e_RankHitCountDESC = 2 } |
Enumeration for rank mode of full text search. More... | |
Public Member Functions | |
FullTextSearch () | |
Constructor. | |
FullTextSearch (const FullTextSearch &other) | |
Constructor, with another full text search object. More... | |
~FullTextSearch () | |
Destructor. | |
bool | IsEmpty () const |
Check whether current object is empty or not. More... | |
bool | operator!= (const FullTextSearch &other) const |
Not equal operator. More... | |
FullTextSearch & | operator= (const FullTextSearch &other) |
Assign operator. More... | |
bool | operator== (const FullTextSearch &other) const |
Equal operator. More... | |
bool | SearchOf (const char *match_string, RankMode rank_mode, SearchCallback *callback) |
Search for specified text among the indexed PDF files. More... | |
void | SetDataBasePath (const char *path_of_data_base) |
Set a file path as sqlite data base which is used for storing the indexed data. More... | |
common::Progressive | StartUpdateIndex (const DocumentsSource &source, common::PauseCallback *pause=0, bool reupdate=false) |
Start to update the index of PDF files defined in a documents source object. More... | |
bool | UpdateIndexWithFilePath (const char *file_path) |
Update the index result of a specified PDF file. More... | |
![]() | |
FS_HANDLE | Handle () const |
Get the handle of current object. More... | |
This class is used to index some PDF files and then search specified text among these indexed PDF files.
Enumeration for rank mode of full text search.
Values of this enumeration should be used alone.
foxit::fts::FullTextSearch::FullTextSearch | ( | const FullTextSearch & | other | ) |
Constructor, with another full text search object.
[in] | other | Another full text search object. |
bool foxit::fts::FullTextSearch::IsEmpty | ( | ) | const |
Check whether current object is empty or not.
When the current object is empty, that means current object is useless.
bool foxit::fts::FullTextSearch::operator!= | ( | const FullTextSearch & | other | ) | const |
Not equal operator.
[in] | other | Another full text search object. This function will check if current object is not equal to this one. |
FullTextSearch& foxit::fts::FullTextSearch::operator= | ( | const FullTextSearch & | other | ) |
Assign operator.
[in] | other | Another full text search object, whose value would be assigned to current object. |
bool foxit::fts::FullTextSearch::operator== | ( | const FullTextSearch & | other | ) | const |
Equal operator.
[in] | other | Another full text search object. This function will check if current object is equal to this one. |
bool foxit::fts::FullTextSearch::SearchOf | ( | const char * | match_string, |
RankMode | rank_mode, | ||
SearchCallback * | 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 FullTextSearch::StartUpdateIndex or FullTextSearch::UpdateIndexWithFilePath. The searching result will be returned through callback function SearchCallback::RetrieveSearchResult, in specified ranking mode.
[in] | match_string | A string to be searched. It should not be an empty string. |
[in] | rank_mode | The ranking mode used for searching results. Please refer to values starting from FullTextSearch::e_RankNone and this should be one of these values. |
[in] | callback | A SearchCallback object. It should not be NULL. User should implement it and use it to retrieve the searching results. |
void foxit::fts::FullTextSearch::SetDataBasePath | ( | const char * | 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 FullTextSearch::StartUpdateIndex or 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.
[in] | path_of_data_base | A file path to specify a file as sqlite data base. It should not be an empty string. |
common::Progressive foxit::fts::FullTextSearch::StartUpdateIndex | ( | const DocumentsSource & | source, |
common::PauseCallback * | pause = 0 , |
||
bool | reupdate = false |
||
) |
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.
[in] | source | A documents source object, which defines a directory to be indexed. |
[in] | pause | Pause 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] | reupdate | true means to re-update the indexes, and false means not to re-update the indexes. Default value: false. |
bool foxit::fts::FullTextSearch::UpdateIndexWithFilePath | ( | const char * | 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.
[in] | file_path | An existed PDF file path. It should not be an empty string. |