Commit 5a74896 1 parent 776976b commit 5a74896 Copy full SHA for 5a74896
File tree 4 files changed +22
-1
lines changed
main/java/de/ids_mannheim/korap
test/java/de/ids_mannheim/korap/search
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
+
1
5
0.63.2 2024-08-02
2
6
- [bugfix] Fix empty DocIdSetIterator (margaretha)
3
7
- [bugfix] Don't throw warnings on expansion failure (diewald)
Original file line number Diff line number Diff line change 35
35
36
36
<groupId >de.ids-mannheim.korap.krill</groupId >
37
37
<artifactId >Krill</artifactId >
38
- <version >0.63.2 </version >
38
+ <version >0.63.3 </version >
39
39
<packaging >jar</packaging >
40
40
41
41
<name >Krill</name >
Original file line number Diff line number Diff line change @@ -1423,6 +1423,12 @@ public Result search (Krill ks) {
1423
1423
return kr ;
1424
1424
};
1425
1425
1426
+ if (cutoff && count == 0 ) {
1427
+ kr .setTotalResults (-1 );
1428
+ kr .setTotalResources (-1 );
1429
+ return kr ;
1430
+ };
1431
+
1426
1432
// Collect matches from atomic readers
1427
1433
final ArrayList <Match > atomicMatches = new ArrayList <Match >(
1428
1434
kr .getItemsPerPage ());
Original file line number Diff line number Diff line change @@ -136,9 +136,20 @@ public void searchIndex () throws IOException {
136
136
assertEquals (kr .getItemsPerPage (), 0 );
137
137
assertEquals (kr .getMatches ().size (), 0 );
138
138
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
+
139
149
// Handle tokens=true and
140
150
// snippet=false correctly
141
151
meta = ks .getMeta ();
152
+ meta .setCutOff (false );
142
153
meta .setCount (1 );
143
154
meta .setTokens (true );
144
155
meta .setSnippets (false );
You can’t perform that action at this time.
0 commit comments