Support for partial queries in catalog search

The search text in the catalog query is interpreted as partial by
default, but partial query mode can be disabled in C++. The latter
possibility is not exposed via the /catalog/search kiwix-serve endpoint,
though.
This commit is contained in:
Veloman Yunkan
2021-03-10 16:18:43 +04:00
committed by Matthieu Gautier
parent 47c67a4202
commit 09233bf4f3
3 changed files with 11 additions and 4 deletions

View File

@ -59,6 +59,7 @@ class Filter {
std::string _creator;
size_t _maxSize;
std::string _query;
bool _queryIsPartial;
std::string _name;
public:
@ -103,11 +104,12 @@ class Filter {
Filter& publisher(std::string publisher);
Filter& creator(std::string creator);
Filter& maxSize(size_t size);
Filter& query(std::string query);
Filter& query(std::string query, bool partial=true);
Filter& name(std::string name);
bool hasQuery() const;
const std::string& getQuery() const { return _query; }
bool queryIsPartial() const { return _queryIsPartial; }
bool accept(const Book& book) const;
bool acceptByQueryOnly(const Book& book) const;