Module org.apache.lucene.grouping
Class AllGroupHeadsCollector.SortingGroupHead<T>
- java.lang.Object
-
- org.apache.lucene.search.grouping.AllGroupHeadsCollector.GroupHead<T>
-
- org.apache.lucene.search.grouping.AllGroupHeadsCollector.SortingGroupHead<T>
-
- Enclosing class:
- AllGroupHeadsCollector<T>
private static class AllGroupHeadsCollector.SortingGroupHead<T> extends AllGroupHeadsCollector.GroupHead<T>
-
-
Field Summary
Fields Modifier and Type Field Description (package private) FieldComparator[]
comparators
(package private) LeafFieldComparator[]
leafComparators
-
Fields inherited from class org.apache.lucene.search.grouping.AllGroupHeadsCollector.GroupHead
doc, docBase, groupValue
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SortingGroupHead(Sort sort, T groupValue, int doc, LeafReaderContext context, Scorable scorer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(int compIDX, int doc)
Compares the specified document for a specified comparator against the current most relevant document.void
setNextReader(LeafReaderContext ctx)
Called for each segmentprotected void
setScorer(Scorable scorer)
Called for each segmentvoid
updateDocHead(int doc)
Updates the current most relevant document with the specified document.
-
-
-
Field Detail
-
comparators
final FieldComparator[] comparators
-
leafComparators
final LeafFieldComparator[] leafComparators
-
-
Constructor Detail
-
SortingGroupHead
protected SortingGroupHead(Sort sort, T groupValue, int doc, LeafReaderContext context, Scorable scorer) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
setNextReader
public void setNextReader(LeafReaderContext ctx) throws java.io.IOException
Description copied from class:AllGroupHeadsCollector.GroupHead
Called for each segment- Overrides:
setNextReader
in classAllGroupHeadsCollector.GroupHead<T>
- Throws:
java.io.IOException
-
setScorer
protected void setScorer(Scorable scorer) throws java.io.IOException
Description copied from class:AllGroupHeadsCollector.GroupHead
Called for each segment- Specified by:
setScorer
in classAllGroupHeadsCollector.GroupHead<T>
- Throws:
java.io.IOException
-
compare
public int compare(int compIDX, int doc) throws java.io.IOException
Description copied from class:AllGroupHeadsCollector.GroupHead
Compares the specified document for a specified comparator against the current most relevant document.- Specified by:
compare
in classAllGroupHeadsCollector.GroupHead<T>
- Parameters:
compIDX
- The comparator index of the specified comparator.doc
- The specified document.- Returns:
- -1 if the specified document wasn't competitive against the current most relevant document, 1 if the specified document was competitive against the current most relevant document. Otherwise 0.
- Throws:
java.io.IOException
- If I/O related errors occur
-
updateDocHead
public void updateDocHead(int doc) throws java.io.IOException
Description copied from class:AllGroupHeadsCollector.GroupHead
Updates the current most relevant document with the specified document.- Specified by:
updateDocHead
in classAllGroupHeadsCollector.GroupHead<T>
- Parameters:
doc
- The specified document- Throws:
java.io.IOException
- If I/O related errors occur
-
-