Class OneDimensionalTermHitCollector
java.lang.Object
org.apache.lucene.search.SimpleCollector
com.atlassian.jira.issue.statistics.util.AbstractOneDimensionalHitCollector
com.atlassian.jira.issue.statistics.util.OneDimensionalTermHitCollector
- All Implemented Interfaces:
org.apache.lucene.search.Collector
,org.apache.lucene.search.LeafCollector
A HitCollector that creates a doc -> term mapping. This is useful for collecting documents where there are a
limited number of terms. The caching also ensures that if multiple searches sort on the same terms, the doc -> term
mapping is maintained.
This HitCollector can be quite memory intensive, however the cache is stored with a weak reference, so it will be garbage collected.
-
Constructor Summary
ConstructorsConstructorDescriptionOneDimensionalTermHitCollector
(String fieldId, FieldVisibilityManager fieldVisibilityManager, ReaderCache readerCache, FieldManager fieldManager) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
collectIrrelevant
(int docId) Implement this if you would like to do something when the hit collector has encountered a docId that contains an irrelevant data matchprotected void
collectWithTerms
(int docId, JiraBytesRef[] terms) Implement this if you would like to do something with the hit we have found.Methods inherited from class com.atlassian.jira.issue.statistics.util.AbstractOneDimensionalHitCollector
collect, doSetNextIndexReader, doSetNextReader, getHitCount, getIrrelevantCount, needsScores
Methods inherited from class org.apache.lucene.search.SimpleCollector
getLeafCollector, setScorer
-
Constructor Details
-
OneDimensionalTermHitCollector
public OneDimensionalTermHitCollector(String fieldId, FieldVisibilityManager fieldVisibilityManager, ReaderCache readerCache, FieldManager fieldManager)
-
-
Method Details
-
collectIrrelevant
protected void collectIrrelevant(int docId) Description copied from class:AbstractOneDimensionalHitCollector
Implement this if you would like to do something when the hit collector has encountered a docId that contains an irrelevant data match- Specified by:
collectIrrelevant
in classAbstractOneDimensionalHitCollector
- Parameters:
docId
- the match we have found. This is an index into the overall directory reader.
-
getResult
-
collectWithTerms
Description copied from class:AbstractOneDimensionalHitCollector
Implement this if you would like to do something with the hit we have found.- Specified by:
collectWithTerms
in classAbstractOneDimensionalHitCollector
- Parameters:
docId
- the doc id of the hit. This is an index into the overall directory reader.terms
- the terms for the fieldId for this document, pre-calculated so you may not need to call getDocument
-