mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-06-26 10:11:30 +00:00
Re-add xapian searcher in kiwix-lib.
libzim only know how to read embedded full text index in a zim file. This is nice as we want to embedded the full text index in zim file and not have separated full text index. However, we still have some zim+separated index we have to read. So we have to support the search in separated index for a while.
This commit is contained in:
@ -5,6 +5,10 @@ headers = [
|
||||
'searcher.h'
|
||||
]
|
||||
|
||||
if xapian_dep.found()
|
||||
headers += ['xapianSearcher.h']
|
||||
endif
|
||||
|
||||
install_headers(headers, subdir:'kiwix')
|
||||
|
||||
install_headers(
|
||||
|
@ -53,7 +53,7 @@ namespace kiwix {
|
||||
class Searcher {
|
||||
|
||||
public:
|
||||
Searcher(Reader* reader);
|
||||
Searcher(const string &xapianDirectoryPath, Reader* reader);
|
||||
~Searcher();
|
||||
|
||||
void search(std::string &search, unsigned int resultStart,
|
||||
|
@ -57,7 +57,7 @@ namespace kiwix {
|
||||
}
|
||||
};
|
||||
|
||||
class XapianSearcher : public Searcher {
|
||||
class XapianSearcher {
|
||||
friend class XapianResult;
|
||||
public:
|
||||
XapianSearcher(const string &xapianDirectoryPath, Reader* reader);
|
||||
@ -67,6 +67,8 @@ namespace kiwix {
|
||||
virtual Result* getNextResult();
|
||||
void restart_search();
|
||||
|
||||
Xapian::MSet results;
|
||||
|
||||
protected:
|
||||
void closeIndex();
|
||||
void openIndex(const string &xapianDirectoryPath);
|
||||
@ -79,7 +81,6 @@ namespace kiwix {
|
||||
Xapian::QueryParser queryParser;
|
||||
Xapian::Stem stemmer;
|
||||
Xapian::SimpleStopper stopper;
|
||||
Xapian::MSet results;
|
||||
Xapian::MSetIterator current_result;
|
||||
std::map<std::string, int> valuesmap;
|
||||
};
|
||||
|
Reference in New Issue
Block a user