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 { ...@@ -53,7 +53,7 @@ public final class SearchResource extends AbstractResource {
@QueryParam("exclude") final List<String> excludedTerms, @QueryParam("exclude") final List<String> excludedTerms,
@QueryParam("ddiElement") final List<String> ddiElements, @QueryParam("ddiElement") final List<String> ddiElements,
@QueryParam("returnType") final List<String> returnTypes, @QueryParam("returnType") final List<String> returnTypes,
@QueryParam("numHits") final int numHits, @QueryParam("maxHits") final int maxHits,
@QueryParam("startIndex") final int startIndex, @QueryParam("startIndex") final int startIndex,
@Context final HttpServletRequest request) { @Context final HttpServletRequest request) {
if (includedTerms.isEmpty()) { if (includedTerms.isEmpty()) {
...@@ -64,7 +64,7 @@ public final class SearchResource extends AbstractResource { ...@@ -64,7 +64,7 @@ public final class SearchResource extends AbstractResource {
@Override @Override
public Object run() throws Exception { public Object run() throws Exception {
Server server = serverHandler.getServer(); Server server = serverHandler.getServer();
return performQuery(server, includedTerms, excludedTerms, returnTypes, ddiElements, numHits, startIndex); return performQuery(server, includedTerms, excludedTerms, returnTypes, ddiElements, maxHits, startIndex);
} }
}, serverHandler); }, serverHandler);
} }
...@@ -80,7 +80,7 @@ public final class SearchResource extends AbstractResource { ...@@ -80,7 +80,7 @@ public final class SearchResource extends AbstractResource {
List<String> excludedTerms, List<String> excludedTerms,
List<String> returnTypes, List<String> returnTypes,
List<String> ddiElements, List<String> ddiElements,
int numHits, int maxHits,
int startIndex) throws NotAuthorizedException, IOException, IllegalTreeOperationException { int startIndex) throws NotAuthorizedException, IOException, IllegalTreeOperationException {
SearchQuery query = new SearchQuery(); SearchQuery query = new SearchQuery();
...@@ -107,8 +107,8 @@ public final class SearchResource extends AbstractResource { ...@@ -107,8 +107,8 @@ public final class SearchResource extends AbstractResource {
query.setStartIndex(startIndex); query.setStartIndex(startIndex);
} }
if (numHits > 0) { if (maxHits > 0) {
query.setNumberOfHits(numHits); query.setNumberOfHits(maxHits);
} else { } else {
query.setNumberOfHits(defaultMaxHits); 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