com.atlassian.jira.issue.statistics.util
Class OneDimensionalObjectHitCollector
java.lang.Object
org.apache.lucene.search.Collector
com.atlassian.jira.issue.statistics.util.OneDimensionalObjectHitCollector
public class OneDimensionalObjectHitCollector
- extends org.apache.lucene.search.Collector
A HitCollector that creates a doc -> object 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 ->
object 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.
This HitCollector differs from OneDimensionalTermHitCollector
in that it performs the term -> object
conversion here, rather than later. This is more expensive, but useful for StatisticsMappers that perform some sort
of runtime conversion / translation (eg a StatisticsMapper that groups dates by Month, or groups users by email
domain name).
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OneDimensionalObjectHitCollector
public OneDimensionalObjectHitCollector(StatisticsMapper statisticsMapper,
Map result,
org.apache.lucene.index.IndexReader indexReader)
collect
public void collect(int i)
- Specified by:
collect
in class org.apache.lucene.search.Collector
setScorer
public void setScorer(org.apache.lucene.search.Scorer scorer)
throws IOException
- Specified by:
setScorer
in class org.apache.lucene.search.Collector
- Throws:
IOException
setNextReader
public void setNextReader(org.apache.lucene.index.IndexReader reader,
int docBase)
throws IOException
- Specified by:
setNextReader
in class org.apache.lucene.search.Collector
- Throws:
IOException
acceptsDocsOutOfOrder
public boolean acceptsDocsOutOfOrder()
- Specified by:
acceptsDocsOutOfOrder
in class org.apache.lucene.search.Collector
Copyright © 2002-2012 Atlassian. All Rights Reserved.