Skip to content

Commit

Permalink
Fix documentation of getResults
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
maneeshpm committed Jul 30, 2021
1 parent 6b69bc0 commit 20ecee8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions include/zim/search.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
4 changes: 2 additions & 2 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 20ecee8

Please sign in to comment.