+ tokenize the search query with Xapian::Query::parser_query() and not anymore with split()

This commit is contained in:
kelson42 2010-07-04 15:55:12 +00:00
parent 4178289614
commit 3555e4f918
2 changed files with 4 additions and 10 deletions

View File

@ -29,17 +29,12 @@ namespace kiwix {
this->results.clear(); this->results.clear();
this->resultOffset = this->results.begin(); this->resultOffset = this->results.begin();
/* Create the query */
Xapian::QueryParser queryParser;
Xapian::Query query = queryParser.parse_query(removeAccents(search));
/* Create the enquire object */ /* Create the enquire object */
Xapian::Enquire enquire(this->readableDatabase); 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); enquire.set_query(query);
if (verbose == true) { if (verbose == true) {

View File

@ -11,7 +11,6 @@
#include <vector> #include <vector>
#include <xapian.h> #include <xapian.h>
#include <unaccent.h> #include <unaccent.h>
#include <splitString.h>
using namespace std; using namespace std;