Check if a valuemaps metadata is available in the database and use it.

This way, we do not make assumption of where the values are stored.
This commit is contained in:
Matthieu Gautier
2017-03-21 16:26:03 +01:00
parent 83d27255cf
commit 9be2abedf3
2 changed files with 67 additions and 8 deletions

View File

@ -22,14 +22,18 @@
#include <xapian.h>
#include "searcher.h"
#include <map>
#include <string>
using namespace std;
namespace kiwix {
class XapianSearcher;
class XapianResult : public Result {
public:
XapianResult(Xapian::MSetIterator& iterator);
XapianResult(XapianSearcher* searcher, Xapian::MSetIterator& iterator);
virtual ~XapianResult() {};
virtual std::string get_url();
@ -40,6 +44,7 @@ namespace kiwix {
virtual int get_size();
private:
XapianSearcher* searcher;
Xapian::MSetIterator iterator;
Xapian::Document document;
};
@ -51,7 +56,7 @@ namespace kiwix {
};
class XapianSearcher : public Searcher {
friend class XapianResult;
public:
XapianSearcher(const string &xapianDirectoryPath);
virtual ~XapianSearcher() {};
@ -68,6 +73,7 @@ namespace kiwix {
Xapian::Stem stemmer;
Xapian::MSet results;
Xapian::MSetIterator current_result;
std::map<std::string, int> valuesmap;
};
}