Commit 9ce7cd95 authored by Eirik Alvær's avatar Eirik Alvær

Fixes #2069 - use maxHits instead of numHits

parent b73a16aa
......@@ -53,7 +53,7 @@ public final class SearchResource extends AbstractResource {
@QueryParam("exclude") final List<String> excludedTerms,
@QueryParam("ddiElement") final List<String> ddiElements,
@QueryParam("returnType") final List<String> returnTypes,
@QueryParam("numHits") final int numHits,
@QueryParam("maxHits") final int maxHits,
@QueryParam("startIndex") final int startIndex,
@Context final HttpServletRequest request) {
if (includedTerms.isEmpty()) {
......@@ -64,7 +64,7 @@ public final class SearchResource extends AbstractResource {
@Override
public Object run() throws Exception {
Server server = serverHandler.getServer();
return performQuery(server, includedTerms, excludedTerms, returnTypes, ddiElements, numHits, startIndex);
return performQuery(server, includedTerms, excludedTerms, returnTypes, ddiElements, maxHits, startIndex);
}
}, serverHandler);
}
......@@ -80,7 +80,7 @@ public final class SearchResource extends AbstractResource {
List<String> excludedTerms,
List<String> returnTypes,
List<String> ddiElements,
int numHits,
int maxHits,
int startIndex) throws NotAuthorizedException, IOException, IllegalTreeOperationException {
SearchQuery query = new SearchQuery();
......@@ -107,8 +107,8 @@ public final class SearchResource extends AbstractResource {
query.setStartIndex(startIndex);
}
if (numHits > 0) {
query.setNumberOfHits(numHits);
if (maxHits > 0) {
query.setNumberOfHits(maxHits);
} else {
query.setNumberOfHits(defaultMaxHits);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment