public abstract class Hits extends Results<Hit>
Modifier and Type | Field and Description |
---|---|
protected CapturedGroupsImpl |
capturedGroups
Our captured groups, or null if we have none.
|
protected int |
docsCounted
The number of separate documents we've counted so far (includes non-retrieved
hits).
|
protected int |
docsRetrieved
The number of separate documents we've seen in the hits retrieved.
|
protected static int |
FETCH_HITS_MIN
Minimum number of hits to fetch in an ensureHitsRead() block.
|
protected int |
hitsCounted
The number of hits we've seen and counted so far.
|
protected static org.apache.logging.log4j.Logger |
logger |
hitsObjId, NO_LIMIT, results, threadPauser
Modifier and Type | Method and Description |
---|---|
CapturedGroupsImpl |
capturedGroups() |
TermFrequencyList |
collocations(Annotation annotation,
ContextSize contextSize)
Count occurrences of context words around hit.
|
TermFrequencyList |
collocations(Annotation annotation,
ContextSize contextSize,
MatchSensitivity sensitivity)
Count occurrences of context words around hit.
|
TermFrequencyList |
collocations(Annotation annotation,
ContextSize contextSize,
MatchSensitivity sensitivity,
boolean sort)
Count occurrences of context words around hit.
|
Concordances |
concordances(ContextSize contextSize)
Create concordances from the forward index.
|
Concordances |
concordances(ContextSize contextSize,
ConcordanceType type) |
protected int |
docsCountedSoFar() |
protected int |
docsCountedTotal() |
protected int |
docsProcessedSoFar() |
protected int |
docsProcessedTotal() |
ResultsStats |
docsStats() |
static Hits |
emptyList(QueryInfo queryInfo)
Construct an empty Hits object.
|
Hits |
filter(ResultProperty<Hit> property,
PropertyValue value)
Select only the hits where the specified property has the specified value.
|
static Hits |
fromArrays(QueryInfo queryInfo,
int[] doc,
int[] start,
int[] end)
Make a wrapper Hits object for a list of Hit objects.
|
static Hits |
fromList(QueryInfo queryInfo,
List<Hit> hits)
Make a wrapper Hits object for a list of Hit objects.
|
static Hits |
fromList(QueryInfo queryInfo,
List<Hit> hits,
CapturedGroups capturedGroups)
Make a wrapper Hits object for a list of Hit objects.
|
static Hits |
fromList(QueryInfo queryInfo,
List<Hit> results,
WindowStats windowStats,
SampleParameters sampleParameters,
int hitsCounted,
int docsRetrieved,
int docsCounted,
CapturedGroupsImpl capturedGroups) |
static Hits |
fromSpanQuery(QueryInfo queryInfo,
BLSpanQuery query,
SearchSettings searchSettings)
Construct a Hits object from a SpanQuery.
|
Hits |
getHitsInDoc(int docid) |
HitGroups |
group(ResultProperty<Hit> criteria,
int maxResultsToStorePerGroup)
Group these hits by a criterium (or several criteria).
|
boolean |
hasCapturedGroups() |
protected int |
hitsCountedSoFar() |
protected int |
hitsCountedTotal() |
protected boolean |
hitsProcessedAtLeast(int lowerBound) |
protected int |
hitsProcessedSoFar() |
protected int |
hitsProcessedTotal() |
ResultsStats |
hitsStats() |
Kwics |
kwics(ContextSize contextSize) |
abstract MaxStats |
maxStats()
Did we exceed the maximum number of hits to process/count?
NOTE: this is only valid for the original Hits instance (that
executes the query), and not for any derived Hits instance (window, sorted, filtered, ...).
|
int |
numberOfResultObjects()
How many result objects does this search store?
Used for estimating the cache size.
|
DocResults |
perDocResults(int maxHits)
Return a per-document view of these hits.
|
protected int |
resultsCountedSoFar() |
protected int |
resultsCountedTotal() |
Hits |
sample(SampleParameters sampleParameters)
Take a sample of hits by wrapping an existing Hits object.
|
int |
size()
This is an alias of resultsProcessedTotal().
|
<P extends ResultProperty<Hit>> |
sort(P sortProp)
Return a new Hits object with these hits sorted by the given property.
|
Hits |
window(Hit hit) |
Hits |
window(int first,
int windowSize)
Get a window into this list of hits.
|
doFilter, doneProcessingAndCounting, doSample, doSort, doWindow, ensureAllResultsRead, ensureResultsRead, field, get, index, isSample, isWindow, iterator, parallelStream, queryInfo, resultsList, resultsObjId, resultsProcessedAtLeast, resultsProcessedSoFar, resultsProcessedTotal, resultsStats, resultsSubList, sampleParameters, stream, threadPauser, toString, windowStats
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
protected static final org.apache.logging.log4j.Logger logger
protected static final int FETCH_HITS_MIN
HitsFromQuery
and HitsFiltered
.protected CapturedGroupsImpl capturedGroups
protected int hitsCounted
protected int docsRetrieved
protected int docsCounted
public Hits(QueryInfo queryInfo)
public static Hits fromSpanQuery(QueryInfo queryInfo, BLSpanQuery query, SearchSettings searchSettings) throws WildcardTermTooBroad
queryInfo
- information about the original queryquery
- the query to execute to get the hitssearchSettings
- settings such as max. hits to process/countWildcardTermTooBroad
- if a wildcard term matches too many terms in the indexpublic static Hits fromList(QueryInfo queryInfo, List<Hit> hits)
queryInfo
- information about the original queryhits
- the list of hits to wrap, or null for empty Hits objectpublic static Hits fromList(QueryInfo queryInfo, List<Hit> hits, CapturedGroups capturedGroups)
queryInfo
- information about the original queryhits
- the list of hits to wrap, or null for empty Hits objectcapturedGroups
- the list of hits to wrap, or null for no captured groupspublic static Hits fromArrays(QueryInfo queryInfo, int[] doc, int[] start, int[] end)
queryInfo
- information about the original querydoc
- doc idsstart
- hit startsend
- hit endspublic static Hits fromList(QueryInfo queryInfo, List<Hit> results, WindowStats windowStats, SampleParameters sampleParameters, int hitsCounted, int docsRetrieved, int docsCounted, CapturedGroupsImpl capturedGroups)
public static Hits emptyList(QueryInfo queryInfo)
queryInfo
- query infopublic Hits sample(SampleParameters sampleParameters)
public Hits window(int first, int windowSize)
public TermFrequencyList collocations(Annotation annotation, ContextSize contextSize, MatchSensitivity sensitivity, boolean sort)
annotation
- what annotation to get collocations forcontextSize
- how many words around the hits to usesensitivity
- what sensitivity to usesort
- sort the resulting collocations by descending frequency?public TermFrequencyList collocations(Annotation annotation, ContextSize contextSize, MatchSensitivity sensitivity)
annotation
- what annotation to get collocations forcontextSize
- how many words around the hits to usesensitivity
- what sensitivity to usepublic TermFrequencyList collocations(Annotation annotation, ContextSize contextSize)
annotation
- what annotation to get collocations forcontextSize
- how many words around the hits to usepublic DocResults perDocResults(int maxHits)
maxHits
- public HitGroups group(ResultProperty<Hit> criteria, int maxResultsToStorePerGroup)
Results
public Hits filter(ResultProperty<Hit> property, PropertyValue value)
public Concordances concordances(ContextSize contextSize)
contextSize
- desired context sizepublic int size()
Results
public Hits getHitsInDoc(int docid)
public ResultsStats hitsStats()
protected boolean hitsProcessedAtLeast(int lowerBound)
protected int hitsProcessedTotal()
protected int hitsProcessedSoFar()
protected int hitsCountedTotal()
public ResultsStats docsStats()
protected int docsProcessedTotal()
protected int docsCountedTotal()
protected int hitsCountedSoFar()
protected int docsCountedSoFar()
protected int docsProcessedSoFar()
protected int resultsCountedTotal()
resultsCountedTotal
in class Results<Hit>
protected int resultsCountedSoFar()
resultsCountedSoFar
in class Results<Hit>
public <P extends ResultProperty<Hit>> Hits sort(P sortProp)
public CapturedGroupsImpl capturedGroups()
public boolean hasCapturedGroups()
public Concordances concordances(ContextSize contextSize, ConcordanceType type)
public Kwics kwics(ContextSize contextSize)
public abstract MaxStats maxStats()
MaxStats.NOT_EXCEEDED
if not available for this instancepublic int numberOfResultObjects()
SearchResult
Copyright © 2020 Instituut voor Nederlandse Taal (INT). All rights reserved.