File tree Expand file tree Collapse file tree 4 files changed +22
-1
lines changed
main/java/de/ids_mannheim/korap
test/java/de/ids_mannheim/korap/search Expand file tree Collapse file tree 4 files changed +22
-1
lines changed Original file line number Diff line number Diff line change 1+ 0.63.3 2024-09-24
2+ - [performance] Improve short circuit on count=0 and
3+ cutoff=true (diewald)
4+
150.63.2 2024-08-02
26 - [bugfix] Fix empty DocIdSetIterator (margaretha)
37 - [bugfix] Don't throw warnings on expansion failure (diewald)
Original file line number Diff line number Diff line change 3535
3636 <groupId >de.ids-mannheim.korap.krill</groupId >
3737 <artifactId >Krill</artifactId >
38- <version >0.63.2 </version >
38+ <version >0.63.3 </version >
3939 <packaging >jar</packaging >
4040
4141 <name >Krill</name >
Original file line number Diff line number Diff line change @@ -1423,6 +1423,12 @@ public Result search (Krill ks) {
14231423 return kr ;
14241424 };
14251425
1426+ if (cutoff && count == 0 ) {
1427+ kr .setTotalResults (-1 );
1428+ kr .setTotalResources (-1 );
1429+ return kr ;
1430+ };
1431+
14261432 // Collect matches from atomic readers
14271433 final ArrayList <Match > atomicMatches = new ArrayList <Match >(
14281434 kr .getItemsPerPage ());
Original file line number Diff line number Diff line change @@ -136,9 +136,20 @@ public void searchIndex () throws IOException {
136136 assertEquals (kr .getItemsPerPage (), 0 );
137137 assertEquals (kr .getMatches ().size (), 0 );
138138
139+ // Handle count=0 correctly
140+ meta = ks .getMeta ();
141+ meta .setCount (0 );
142+ meta .setCutOff (true );
143+
144+ kr = ks .apply (ki );
145+ assertEquals (kr .getTotalResults (), -1 );
146+ assertEquals (kr .getItemsPerPage (), 0 );
147+ assertEquals (kr .getMatches ().size (), 0 );
148+
139149 // Handle tokens=true and
140150 // snippet=false correctly
141151 meta = ks .getMeta ();
152+ meta .setCutOff (false );
142153 meta .setCount (1 );
143154 meta .setTokens (true );
144155 meta .setSnippets (false );
You can’t perform that action at this time.
0 commit comments