Fix limits

This commit is contained in:
Andrea Cavalli 2021-02-24 23:16:56 +01:00
parent 385e29aee5
commit c3be27c15b
2 changed files with 3 additions and 5 deletions

View File

@ -515,12 +515,10 @@ public class LLLocalLuceneIndex implements LLLuceneIndex {
allowOnlyQueryParsingCollectorStreamSearcher.search(indexSearcher, luceneQuery);
totalHitsCountSink.tryEmitValue(0L);
} else {
if (limit > Integer.MAX_VALUE) {
throw new NumberIsTooLargeException(limit, Integer.MAX_VALUE, true);
}
int boundedLimit = Math.max(0, limit > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) limit);
streamSearcher.search(indexSearcher,
luceneQuery,
(int) limit,
boundedLimit,
luceneSort,
luceneScoreMode,
minCompetitiveScore,

View File

@ -319,7 +319,7 @@ public class LLLocalMultiLuceneIndex implements LLLuceneIndex {
.getT1()
.distributedSearch(tuple.getT2().orElse(null),
query,
Integer.MAX_VALUE,
limit,
sort,
scoreMode,
minCompetitiveScore,