benwtrent commented on code in PR #15167:
URL: https://github.com/apache/lucene/pull/15167#discussion_r2333292145
##########
lucene/grouping/src/java/org/apache/lucene/search/grouping/FirstPassGroupingCollector.java:
##########
@@ -363,4 +388,15 @@ protected void doSetNextReader(LeafReaderContext
readerContext) throws IOExcepti
public GroupSelector<T> getGroupSelector() {
return groupSelector;
}
+
+ private boolean isNullGroupValue(T groupValue) {
+ if (groupValue == null) {
+ return true;
+ }
+ // For ValueSourceGroupSelector, check if MutableValue exists
+ if (groupValue instanceof MutableValue) {
+ return !((MutableValue) groupValue).exists();
+ }
Review Comment:
```suggestion
if (groupValue instanceof MutableValue mutable) {
return mutable.exists() == false;
}
```
##########
lucene/CHANGES.txt:
##########
@@ -315,6 +315,8 @@ Optimizations
and uses an optimized branchless approach. Any subclasses that have
implemented the optimized method
need to remove it as it will disappear in Lucene 11. (Uwe Schindler)
+* GITHUB#15167: FirstPassGroupingCollector supports ignoring docs without
group field (Binlong Gao)
Review Comment:
let's put this under 10.4, 10.3 is already cut.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]