From cca5980b2713671a169449283602422de24d56f1 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Thu, 8 Aug 2019 17:04:41 +0200 Subject: [PATCH] Remove limitation of the search len in the Searcher. The limitation should be made elsewhere (the code using the searcher). --- src/searcher.cpp | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/src/searcher.cpp b/src/searcher.cpp index 90d9ea911..4b9125ed5 100644 --- a/src/searcher.cpp +++ b/src/searcher.cpp @@ -107,22 +107,8 @@ void Searcher::search(std::string& search, cout << "Performing query `" << search << "'" << endl; } - /* If resultEnd & resultStart inverted */ - if (resultStart > resultEnd) { - resultEnd += resultStart; - resultStart = resultEnd - resultStart; - resultEnd -= resultStart; - } - /* Try to find results */ if (resultStart != resultEnd) { - /* Avoid big researches */ - this->resultCountPerPage = resultEnd - resultStart; - if (this->resultCountPerPage > MAX_SEARCH_LEN) { - resultEnd = resultStart + MAX_SEARCH_LEN; - this->resultCountPerPage = MAX_SEARCH_LEN; - } - /* Perform the search */ this->searchPattern = search; this->resultStart = resultStart; @@ -159,25 +145,11 @@ void Searcher::geo_search(float latitude, float longitude, float distance, cout << "Performing geo query `" << distance << "&(" << latitude << ";" << longitude << ")'" << endl; } - /* If resultEnd & resultStart inverted */ - if (resultStart > resultEnd) { - resultEnd += resultStart; - resultStart = resultEnd - resultStart; - resultEnd -= resultStart; - } - /* Try to find results */ if (resultStart == resultEnd) { return; } - /* Avoid big researches */ - this->resultCountPerPage = resultEnd - resultStart; - if (this->resultCountPerPage > MAX_SEARCH_LEN) { - resultEnd = resultStart + MAX_SEARCH_LEN; - this->resultCountPerPage = MAX_SEARCH_LEN; - } - /* Perform the search */ std::ostringstream oss; oss << "Articles located less than " << distance << " meters of " << latitude << ";" << longitude;