diff --git a/src/searcher.cpp b/src/searcher.cpp index 4d603d1d..6802d663 100644 --- a/src/searcher.cpp +++ b/src/searcher.cpp @@ -108,12 +108,12 @@ void Searcher::search(std::string& search, cout << "Performing query `" << search << "'" << endl; } + this->searchPattern = search; + this->resultStart = resultStart; + this->resultEnd = resultEnd; /* Try to find results */ if (resultStart != resultEnd) { /* Perform the search */ - this->searchPattern = search; - this->resultStart = resultStart; - this->resultEnd = resultEnd; string unaccentedSearch = removeAccents(search); std::vector zims; for (auto current = this->readers.begin(); current != this->readers.end(); @@ -146,11 +146,6 @@ void Searcher::geo_search(float latitude, float longitude, float distance, cout << "Performing geo query `" << distance << "&(" << latitude << ";" << longitude << ")'" << endl; } - /* Try to find results */ - if (resultStart == resultEnd) { - return; - } - /* Perform the search */ std::ostringstream oss; oss << "Articles located less than " << distance << " meters of " << latitude << ";" << longitude; @@ -158,6 +153,11 @@ void Searcher::geo_search(float latitude, float longitude, float distance, this->resultStart = resultStart; this->resultEnd = resultEnd; + /* Try to find results */ + if (resultStart == resultEnd) { + return; + } + std::vector zims; for (auto current = this->readers.begin(); current != this->readers.end(); current++) {