mirror of https://github.com/kiwix/libkiwix.git
+ tokenize the search query with Xapian::Query::parser_query() and not anymore with split()
This commit is contained in:
parent
4178289614
commit
3555e4f918
|
@ -29,17 +29,12 @@ namespace kiwix {
|
|||
this->results.clear();
|
||||
this->resultOffset = this->results.begin();
|
||||
|
||||
/* Create the query */
|
||||
Xapian::QueryParser queryParser;
|
||||
Xapian::Query query = queryParser.parse_query(removeAccents(search));
|
||||
|
||||
/* Create the enquire object */
|
||||
Xapian::Enquire enquire(this->readableDatabase);
|
||||
|
||||
/* Create the query term vector */
|
||||
/* I have the doublequote " because bug ID: 2939690 */
|
||||
std::vector<std::string> queryTerms = split(removeAccents(search), " #@%$0/\\_-*()[]{},;:\"'");
|
||||
|
||||
/* Create query object */
|
||||
Xapian::Query query(Xapian::Query::OP_OR, queryTerms.begin(), queryTerms.end());
|
||||
|
||||
/* Set the query in the enquire object */
|
||||
enquire.set_query(query);
|
||||
|
||||
if (verbose == true) {
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
#include <vector>
|
||||
#include <xapian.h>
|
||||
#include <unaccent.h>
|
||||
#include <splitString.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
|
Loading…
Reference in New Issue