Foxit PDF SDK

fs_fulltextsearch.h
Go to the documentation of this file.
1
15 #ifndef FS_FULLTEXTSEARCH_H_
16 #define FS_FULLTEXTSEARCH_H_
17
18 #include "common/fs_common.h"
19
25 namespace foxit {
29 namespace fts {
37 class SearchCallback {
38 public:
44 virtual void Release() = 0;
60 virtual int RetrieveSearchResult(const wchar_t* file_path, int page_index, const WString& match_result,
61 int match_start_text_index, int match_end_text_index, const WString& sentence,
62 int match_sentence_start_text_index, int match_sentence_end_text_index) = 0;
63
64 protected:
65 ~SearchCallback() {}
66 };
67
72 class DocumentsSource FS_FINAL : public Base{
73 public:
79 explicit DocumentsSource(const char* directory);
81 ~DocumentsSource();
87 DocumentsSource(const DocumentsSource& other);
95 DocumentsSource& operator = (const DocumentsSource& other);
96
104 bool operator == (const DocumentsSource& other) const;
112 bool operator != (const DocumentsSource& other) const;
113
121 bool IsEmpty() const;
122
123 // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
124 explicit DocumentsSource(FS_HANDLE handle = NULL);
125
126 };
127
131 class FullTextSearch FS_FINAL : public Base{
132 public:
138 typedef enum _RankMode {
140 e_RankNone = 0,
145 e_RankHitCountASC = 1,
150 e_RankHitCountDESC = 2
151 } RankMode;
152
153
155 FullTextSearch();
157 ~FullTextSearch();
163 FullTextSearch(const FullTextSearch& other);
171 FullTextSearch& operator = (const FullTextSearch& other);
172
180 bool operator == (const FullTextSearch& other) const;
188 bool operator != (const FullTextSearch& other) const;
196 bool IsEmpty() const;
197
211 void SetDataBasePath(const char* path_of_data_base);
212
233 common::Progressive StartUpdateIndex(const DocumentsSource& source, common::PauseCallback* pause = NULL,
234 bool reupdate = false);
235
245 bool UpdateIndexWithFilePath(const char* file_path);
246
263 bool SearchOf(const char* match_string, RankMode rank_mode, SearchCallback* callback);
264
265 // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
266 explicit FullTextSearch(FS_HANDLE handle);
267 };
268 } // namespace fts
269 }; // namespace foxit
270
271 #endif // FS_FULLTEXTSEARCH_H_
272
foxit::fts::FullTextSearch::e_RankHitCountASC
Rank the searching results according to how the result matches the expected searching patten,...
Definition: fs_fulltextsearch.h:145
foxit::FS_HANDLE
void * FS_HANDLE
Handle type.
Definition: fs_basictypes.h:213
foxit::fts::FullTextSearch::StartUpdateIndex
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.
foxit::fts::FullTextSearch::FullTextSearch
FullTextSearch()
Constructor.
foxit::common::Progressive
Definition: fs_common.h:373
foxit::fts::DocumentsSource
Definition: fs_fulltextsearch.h:72
foxit::fts::FullTextSearch::UpdateIndexWithFilePath
bool UpdateIndexWithFilePath(const char *file_path)
Update the index result of a specified PDF file.
fs_common.h
Header file for common definitions and classes.
foxit::fts::FullTextSearch
Definition: fs_fulltextsearch.h:131
foxit::fts::FullTextSearch::SearchOf
bool SearchOf(const char *match_string, RankMode rank_mode, SearchCallback *callback)
Search for specified text among the indexed PDF files.
foxit::fts::FullTextSearch::SetDataBasePath
void SetDataBasePath(const char *path_of_data_base)
Set a file path as sqlite data base which is used for storing the indexed data.
foxit::fts::DocumentsSource::IsEmpty
bool IsEmpty() const
Check whether current object is empty or not.
foxit::fts::SearchCallback
Definition: fs_fulltextsearch.h:37
foxit::fts::DocumentsSource::DocumentsSource
DocumentsSource(const char *directory)
Constructor, with a directory.
foxit::fts::SearchCallback::RetrieveSearchResult
virtual int RetrieveSearchResult(const wchar_t *file_path, int page_index, const WString &match_result, int match_start_text_index, int match_end_text_index, const WString &sentence, int match_sentence_start_text_index, int match_sentence_end_text_index)=0
A callback function used to retrieve the searching result.
foxit::fts::FullTextSearch::RankMode
RankMode
Enumeration for rank mode of full text search.
Definition: fs_fulltextsearch.h:138
foxit::fts::DocumentsSource::~DocumentsSource
~DocumentsSource()
Destructor.
foxit::fts::FullTextSearch::e_RankNone
No ranking mode is used for searching results.
Definition: fs_fulltextsearch.h:140
foxit::fts::FullTextSearch::~FullTextSearch
~FullTextSearch()
Destructor.
foxit::fts::SearchCallback::Release
virtual void Release()=0
A callback function used to release current callback object itself.
foxit
Foxit namespace.
Definition: fs_taggedpdf.h:27
foxit::fts::FullTextSearch::operator!=
bool operator!=(const FullTextSearch &other) const
Not equal operator.
IFX_Pause
Definition: fx_basic.h:3758
foxit::fts::DocumentsSource::operator=
DocumentsSource & operator=(const DocumentsSource &other)
Assign operator.
NULL
#define NULL
The null-pointer value.
Definition: fx_system.h:792
foxit::fts::FullTextSearch::operator=
FullTextSearch & operator=(const FullTextSearch &other)
Assign operator.
foxit::fts::DocumentsSource::operator!=
bool operator!=(const DocumentsSource &other) const
Not equal operator.
foxit::fts::FullTextSearch::IsEmpty
bool IsEmpty() const
Check whether current object is empty or not.
foxit::fts::FullTextSearch::e_RankHitCountDESC
Rank the searching results according to how the result matches the expected searching patten,...
Definition: fs_fulltextsearch.h:150
CFX_WideString
WIDE STRING CLASS.
Definition: fx_string.h:1461
foxit::fts::DocumentsSource::operator==
bool operator==(const DocumentsSource &other) const
Equal operator.
foxit::Base
Definition: fs_basictypes.h:451
foxit::fts::FullTextSearch::operator==
bool operator==(const FullTextSearch &other) const
Equal operator.