com.atlassian.jira.issue.statistics.util
Class TwoDimensionalTermHitCollector

java.lang.Object
  extended by org.apache.lucene.search.HitCollector
      extended by com.atlassian.jira.issue.statistics.util.TwoDimensionalTermHitCollector

public class TwoDimensionalTermHitCollector
extends org.apache.lucene.search.HitCollector

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.

Since:
v3.11

Constructor Summary
TwoDimensionalTermHitCollector(TwoDimensionalStatsMap statsMap, org.apache.lucene.index.IndexReader indexReader, FieldVisibilityManager fieldVisibilityManager, ReaderCache readerCache)
           
TwoDimensionalTermHitCollector(TwoDimensionalStatsMap statsMap, org.apache.lucene.index.IndexReader indexReader, FieldVisibilityManager fieldVisibilityManager, ReaderCache readerCache, LuceneFieldSorter aggregateField)
          Update a statsMap, using the values from the aggregateField.
 
Method Summary
 void collect(int i, float v)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TwoDimensionalTermHitCollector

public TwoDimensionalTermHitCollector(TwoDimensionalStatsMap statsMap,
                                      org.apache.lucene.index.IndexReader indexReader,
                                      FieldVisibilityManager fieldVisibilityManager,
                                      ReaderCache readerCache)

TwoDimensionalTermHitCollector

public TwoDimensionalTermHitCollector(TwoDimensionalStatsMap statsMap,
                                      org.apache.lucene.index.IndexReader indexReader,
                                      FieldVisibilityManager fieldVisibilityManager,
                                      ReaderCache readerCache,
                                      LuceneFieldSorter aggregateField)
Update a statsMap, using the values from the aggregateField. Example, you can sum the votes.

Parameters:
statsMap - stats map
indexReader - index reader
fieldVisibilityManager - used to determine if the stat fields are visible
readerCache - used to cache stats values at the reader level
aggregateField - lucene field sorter
Method Detail

collect

public void collect(int i,
                    float v)
Specified by:
collect in class org.apache.lucene.search.HitCollector


Copyright © 2002-2010 Atlassian. All Rights Reserved.