public class HitGroups extends Results<HitGroup> implements ResultGroups<Hit>
hitsObjId, NO_LIMIT, results, threadPauser
Modifier | Constructor and Description |
---|---|
protected |
HitGroups(Hits hits,
HitProperty criteria,
int maxResultsToStorePerGroup)
Construct a ResultsGrouper object, by grouping the supplied hits.
|
protected |
HitGroups(QueryInfo queryInfo,
List<HitGroup> groups,
HitProperty groupCriteria,
SampleParameters sampleParameters,
WindowStats windowStats) |
Modifier and Type | Method and Description |
---|---|
boolean |
doneProcessingAndCounting()
Check if we're done retrieving/counting hits.
|
protected void |
ensureResultsRead(int number)
Ensure that we have read at least as many results as specified in the parameter.
|
HitGroups |
filter(ResultProperty<HitGroup> property,
PropertyValue value)
Select only the hits where the specified property has the specified value.
|
static HitGroups |
fromHits(Hits hits,
HitProperty criteria,
int maxResultsToStorePerGroup)
Construct HitGroups from a list of hits.
|
static HitGroups |
fromList(QueryInfo queryInfo,
List<HitGroup> results,
HitProperty groupCriteria,
SampleParameters sampleParameters,
WindowStats windowStats)
Construct HitGroups from a list of HitGroup instances.
|
HitGroup |
get(PropertyValue identity) |
Map<PropertyValue,HitGroup> |
getGroupMap() |
ResultGroups<HitGroup> |
group(ResultProperty<HitGroup> criteria,
int maxResultsToStorePerGroup)
Group these hits by a criterium (or several criteria).
|
HitProperty |
groupCriteria()
What were these results grouped on?
|
int |
largestGroupSize()
Return the size of the largest group
|
int |
numberOfResultObjects()
How many result objects does this search store?
Used for estimating the cache size.
|
HitGroups |
sample(SampleParameters sampleParameters)
Take a sample of hits by wrapping an existing Hits object.
|
SampleParameters |
sampleParameters()
If this is a sample, return the sample parameters.
|
int |
size()
This is an alias of resultsProcessedTotal().
|
<P extends ResultProperty<HitGroup>> |
sort(P sortProp)
Return a new Results object with these results sorted by the given property.
|
int |
sumOfGroupSizes()
Get the total number of hits
|
String |
toString() |
HitGroups |
window(int first,
int number)
Get a window into this list of results.
|
WindowStats |
windowStats()
If this is a hits window, return the window stats.
|
HitGroups |
withFewerStoredResults(int maximumNumberOfResultsPerGroup)
Get an instance of this grouping with fewer stored results per group.
|
doFilter, doSample, doSort, doWindow, ensureAllResultsRead, field, get, index, isSample, isWindow, iterator, parallelStream, queryInfo, resultsCountedSoFar, resultsCountedTotal, resultsList, resultsObjId, resultsProcessedAtLeast, resultsProcessedSoFar, resultsProcessedTotal, resultsStats, resultsSubList, stream, threadPauser
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
field, get, index, queryInfo
forEach, spliterator
protected HitGroups(Hits hits, HitProperty criteria, int maxResultsToStorePerGroup)
hits
- the hits to groupcriteria
- the criteria to group onmaxResultsToStorePerGroup
- how many results to store per group at mostprotected HitGroups(QueryInfo queryInfo, List<HitGroup> groups, HitProperty groupCriteria, SampleParameters sampleParameters, WindowStats windowStats)
public static HitGroups fromList(QueryInfo queryInfo, List<HitGroup> results, HitProperty groupCriteria, SampleParameters sampleParameters, WindowStats windowStats)
queryInfo
- query inforesults
- list of groupsgroupCriteria
- what hits would be grouped bysampleParameters
- how groups were sampled, or null if not applicablewindowStats
- what groups window this is, or null if not applicablepublic static HitGroups fromHits(Hits hits, HitProperty criteria, int maxResultsToStorePerGroup)
hits
- hits to groupcriteria
- criteria to group bymaxResultsToStorePerGroup
- max results to storepublic HitProperty groupCriteria()
ResultGroups
groupCriteria
in interface ResultGroups<Hit>
public <P extends ResultProperty<HitGroup>> HitGroups sort(P sortProp)
Results
protected void ensureResultsRead(int number)
Results
ensureResultsRead
in class Results<HitGroup>
number
- the minimum number of results that will have been read when this
method returns (unless there are fewer hits than this); if
negative, reads all hitspublic HitGroups sample(SampleParameters sampleParameters)
public int sumOfGroupSizes()
sumOfGroupSizes
in interface ResultGroups<Hit>
public int largestGroupSize()
largestGroupSize
in interface ResultGroups<Hit>
public HitGroup get(PropertyValue identity)
get
in interface ResultGroups<Hit>
public int size()
Results
public WindowStats windowStats()
Results
windowStats
in class Results<HitGroup>
public SampleParameters sampleParameters()
Results
sampleParameters
in class Results<HitGroup>
public HitGroups window(int first, int number)
Results
public HitGroups filter(ResultProperty<HitGroup> property, PropertyValue value)
Results
public ResultGroups<HitGroup> group(ResultProperty<HitGroup> criteria, int maxResultsToStorePerGroup)
Results
public HitGroups withFewerStoredResults(int maximumNumberOfResultsPerGroup)
ResultGroups
withFewerStoredResults
in interface ResultGroups<Hit>
maximumNumberOfResultsPerGroup
- maximum number of results to store, or -1 for the samepublic boolean doneProcessingAndCounting()
Results
doneProcessingAndCounting
in class Results<HitGroup>
public Map<PropertyValue,HitGroup> getGroupMap()
getGroupMap
in interface ResultGroups<Hit>
public int numberOfResultObjects()
SearchResult
numberOfResultObjects
in interface SearchResult
Copyright © 2020 Instituut voor Nederlandse Taal (INT). All rights reserved.