mirror of https://github.com/kiwix/libkiwix.git
Always use the search pattern when searching in the server.
There is no reason to not use the pattern if there is a geo_query. If both the pattern and the qeo_query are provided, we must use both.
This commit is contained in:
parent
f2a1c0f106
commit
311f783ea9
|
@ -140,19 +140,18 @@ SearchInfo::SearchInfo(const RequestContext& request)
|
|||
|
||||
zim::Query SearchInfo::getZimQuery(bool verbose) const {
|
||||
zim::Query query;
|
||||
if(pattern.empty()) {
|
||||
// Execute geo-search
|
||||
if (verbose) {
|
||||
std::cout << "Performing query '" << pattern<< "'";
|
||||
}
|
||||
query.setQuery(pattern);
|
||||
if (geoQuery) {
|
||||
if (verbose) {
|
||||
cout << "Performing geo query `" << geoQuery.distance << "&(" << geoQuery.latitude << ";" << geQuery.longitude << ")'" << endl;
|
||||
std::cout << " with geo query '" << geoQuery.distance << "&(" << geoQuery.latitude << ";" << geoQuery.longitude << ")'";
|
||||
}
|
||||
query.setQuery("");
|
||||
query.setGeorange(geoQuery.latitude, geoQuery.longitude, geoQuery.distance);
|
||||
} else {
|
||||
// Execute Ft search
|
||||
if (verbose) {
|
||||
cout << "Performing query `" << pattern << "'" << endl;
|
||||
}
|
||||
query.setQuery(pattern);
|
||||
}
|
||||
if (verbose) {
|
||||
std::cout << std::endl;
|
||||
}
|
||||
return query;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue