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 SearchInfo::getZimQuery(bool verbose) const {
|
||||||
zim::Query query;
|
zim::Query query;
|
||||||
if(pattern.empty()) {
|
|
||||||
// Execute geo-search
|
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
cout << "Performing geo query `" << geoQuery.distance << "&(" << geoQuery.latitude << ";" << geQuery.longitude << ")'" << endl;
|
std::cout << "Performing query '" << pattern<< "'";
|
||||||
}
|
|
||||||
query.setQuery("");
|
|
||||||
query.setGeorange(geoQuery.latitude, geoQuery.longitude, geoQuery.distance);
|
|
||||||
} else {
|
|
||||||
// Execute Ft search
|
|
||||||
if (verbose) {
|
|
||||||
cout << "Performing query `" << pattern << "'" << endl;
|
|
||||||
}
|
}
|
||||||
query.setQuery(pattern);
|
query.setQuery(pattern);
|
||||||
|
if (geoQuery) {
|
||||||
|
if (verbose) {
|
||||||
|
std::cout << " with geo query '" << geoQuery.distance << "&(" << geoQuery.latitude << ";" << geoQuery.longitude << ")'";
|
||||||
|
}
|
||||||
|
query.setGeorange(geoQuery.latitude, geoQuery.longitude, geoQuery.distance);
|
||||||
|
}
|
||||||
|
if (verbose) {
|
||||||
|
std::cout << std::endl;
|
||||||
}
|
}
|
||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue