From 20ecee84ce9921189e4b130991148b5c8a153a19 Mon Sep 17 00:00:00 2001 From: Maneesh P M Date: Fri, 30 Jul 2021 22:05:38 +0530 Subject: [PATCH] Fix documentation of getResults getReturn should follow the same convention used by Xapian for consistency. The second argument maxResults is the maximum number of results to return starting from the first argument start. --- include/zim/search.h | 6 +++--- src/search.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/zim/search.h b/include/zim/search.h index ae4c54627..61bf7623d 100644 --- a/include/zim/search.h +++ b/include/zim/search.h @@ -167,10 +167,10 @@ class Search * * @param start The begining of the range to get * (offset of the first result). - * @param end The end of the range to get - * (offset of the result past the end of the range). + * @param maxResults The maximum number of results to return + * (offset of last result from the start of range). */ - const SearchResultSet getResults(int start, int end) const; + const SearchResultSet getResults(int start, int maxResults) const; /** Get the number of estimated results for this search. * diff --git a/src/search.cpp b/src/search.cpp index 7049bbe94..461a15472 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -357,10 +357,10 @@ int Search::getEstimatedMatches() const } } -const SearchResultSet Search::getResults(int start, int end) const { +const SearchResultSet Search::getResults(int start, int maxResults) const { try { auto enquire = getEnquire(); - auto mset = enquire.get_mset(start, end); + auto mset = enquire.get_mset(start, maxResults); return SearchResultSet(mp_internalDb, std::move(mset)); } catch(Xapian::QueryParserError& e) { return SearchResultSet(mp_internalDb);