public class OneDimensionalObjectHitCollector
extends org.apache.lucene.search.Collector
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).Constructor and Description |
---|
OneDimensionalObjectHitCollector(StatisticsMapper statisticsMapper,
Map result)
Creates a normal one-dimensional object hit collector.
|
OneDimensionalObjectHitCollector(StatisticsMapper statisticsMapper,
Map result,
boolean isUnique)
Allows the caller to specify whether or not the hit collector may assume that the
field will never have more than one value for any issue.
|
Modifier and Type | Method and Description |
---|---|
boolean |
acceptsDocsOutOfOrder() |
void |
collect(int i) |
void |
setNextReader(org.apache.lucene.index.IndexReader reader,
int docBase) |
void |
setScorer(org.apache.lucene.search.Scorer scorer) |
public OneDimensionalObjectHitCollector(StatisticsMapper statisticsMapper, Map result)
OneDimensionalObjectHitCollector(StatisticsMapper, Map, boolean)
} with
false provided for isUnique, which should be safe for use with all fields.
However, if it is known in advance that the field contains at most one value for the field,
then specifying isUnique will be more efficient.statisticsMapper
- provides the information required to map the fieldresult
- the map to which the result will be published@ExperimentalApi public OneDimensionalObjectHitCollector(StatisticsMapper statisticsMapper, Map result, boolean isUnique)
statisticsMapper
- provides the information required to map the fieldresult
- the map to which the result will be publishedisUnique
- true if the field can safely be assumed to have at most one value
for any issue; false if the field might be allowed to contain multiple values
per issuepublic void collect(int i)
collect
in class org.apache.lucene.search.Collector
public void setScorer(org.apache.lucene.search.Scorer scorer) throws IOException
setScorer
in class org.apache.lucene.search.Collector
IOException
public void setNextReader(org.apache.lucene.index.IndexReader reader, int docBase) throws IOException
setNextReader
in class org.apache.lucene.search.Collector
IOException
public boolean acceptsDocsOutOfOrder()
acceptsDocsOutOfOrder
in class org.apache.lucene.search.Collector
Copyright © 2002-2015 Atlassian. All Rights Reserved.