mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-06-26 10:11:30 +00:00
Try to generate the snippet if it is not present in the database.
We generate the snippet from the content of the article in the zim so we need to have a access to the reader.
This commit is contained in:
@ -22,6 +22,8 @@
|
||||
|
||||
#include <xapian.h>
|
||||
#include "searcher.h"
|
||||
#include "reader.h"
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
@ -58,7 +60,7 @@ namespace kiwix {
|
||||
class XapianSearcher : public Searcher {
|
||||
friend class XapianResult;
|
||||
public:
|
||||
XapianSearcher(const string &xapianDirectoryPath);
|
||||
XapianSearcher(const string &xapianDirectoryPath, Reader* reader);
|
||||
virtual ~XapianSearcher() {};
|
||||
void searchInIndex(string &search, const unsigned int resultStart, const unsigned int resultEnd,
|
||||
const bool verbose=false);
|
||||
@ -69,6 +71,7 @@ namespace kiwix {
|
||||
void closeIndex();
|
||||
void openIndex(const string &xapianDirectoryPath);
|
||||
|
||||
Reader* reader;
|
||||
Xapian::Database readableDatabase;
|
||||
Xapian::Stem stemmer;
|
||||
Xapian::MSet results;
|
||||
|
Reference in New Issue
Block a user