Foxit PDF SDK
fs_fulltextsearch.h
浏览该文件的文档.
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 {
38  public:
44  virtual void Release() = 0;
59  virtual int RetrieveSearchResult(const wchar_t* file_path, int page_index, const WString& match_result,
60  int match_start_text_index, int match_end_text_index, const WString& sentence,
61  int match_sentence_start_text_index, int match_sentence_end_text_index) = 0;
62 
63  protected:
64  ~SearchCallback() {}
65 };
66 
71 class DocumentsSource FS_FINAL : public Base{
72  public:
78  explicit DocumentsSource(const char* directory);
86  DocumentsSource(const DocumentsSource& other);
95 
103  bool operator == (const DocumentsSource& other) const;
111  bool operator != (const DocumentsSource& other) const;
112 
120  bool IsEmpty() const;
121 
122  // 强烈建议用户不要使用此方法;否则可能出现未知情况。
123  explicit DocumentsSource(FS_HANDLE handle = NULL);
124 
125 };
126 
130 class FullTextSearch FS_FINAL : public Base{
131  public:
137  typedef enum _RankMode {
150  } RankMode;
151 
152 
154  FullTextSearch();
156  ~FullTextSearch();
162  FullTextSearch(const FullTextSearch& other);
171 
179  bool operator == (const FullTextSearch& other) const;
187  bool operator != (const FullTextSearch& other) const;
195  bool IsEmpty() const;
196 
211  void SetDataBasePath(const char* path_of_data_base);
212 
233  bool reupdate = false);
234 
244  bool UpdateIndexWithFilePath(const char* file_path);
245 
262  bool SearchOf(const char* match_string, RankMode rank_mode, SearchCallback* callback);
263 
264  // 强烈建议用户不要使用此方法;否则可能出现未知情况。
265  explicit FullTextSearch(FS_HANDLE handle);
266 };
267 } // namespace fts
268 }; // namespace foxit
269 
270 #endif // FS_FULLTEXTSEARCH_H_
271 
virtual void Release()=0
用于释放当前回调对象本身的回调函数。
DocumentsSource(const char *directory)
用目录构造函数。
Definition: fs_fulltextsearch.h:71
搜索结果不使用排序模式。
Definition: fs_fulltextsearch.h:139
Definition: fs_fulltextsearch.h:37
bool IsEmpty() const
检查当前对象是否为空。
bool UpdateIndexWithFilePath(const char *file_path)
更新指定PDF文件的索引结果。
宽字符串类
Definition: fx_string.h:1457
根据结果与预期搜索模式的匹配程度对搜索结果进行排序, 按降序排列(从相同或最相似到相似度较低)。
Definition: fs_fulltextsearch.h:149
FullTextSearch & operator=(const FullTextSearch &other)
赋值操作符。
Definition: fs_fulltextsearch.h:130
void SetDataBasePath(const char *path_of_data_base)
设置文件路径作为用于存储索引数据的sqlite数据库。
DocumentsSource & operator=(const DocumentsSource &other)
赋值操作符。
~FullTextSearch()
析构函数。
RankMode
全文搜索的排序模式枚举。
Definition: fs_fulltextsearch.h:137
Definition: fx_basic.h:3737
Definition: fs_common.h:373
void * FS_HANDLE
句柄类型。
Definition: fs_basictypes.h:214
通用定义和类的头文件。
~DocumentsSource()
析构函数。
bool operator !=(const FullTextSearch &other) const
不相等操作符。
Definition: fs_basictypes.h:449
bool SearchOf(const char *match_string, RankMode rank_mode, SearchCallback *callback)
在已索引的PDF文件中搜索指定的文本。
bool operator==(const DocumentsSource &other) const
相等操作符。
common::Progressive StartUpdateIndex(const DocumentsSource &source, common::PauseCallback *pause=0, bool reupdate=false)
开始更新文档源对象中定义的PDF文件的索引。
Foxit命名空间。
Definition: fs_taggedpdf.h:27
bool operator !=(const DocumentsSource &other) const
不相等操作符。
bool IsEmpty() const
检查当前对象是否为空。
#define NULL
空指针值。
Definition: fx_system.h:792
FullTextSearch()
构造函数。
根据结果与预期搜索模式的匹配程度对搜索结果进行排序, 按升序排列(从相似度较低到最相似或相同)。
Definition: fs_fulltextsearch.h:144
bool operator==(const FullTextSearch &other) const
相等操作符。
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
用于检索搜索结果的回调函数。