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

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

public class OneDimensionalTermHitCollector
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.


Constructor Summary
OneDimensionalTermHitCollector(String luceneGroupField, Map result, org.apache.lucene.index.IndexReader indexReader)
           
 
Method Summary
 void collect(int i, float v)
           
 long getHitCount()
          Returns the number of times the collect(int, float) method was called.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OneDimensionalTermHitCollector

public OneDimensionalTermHitCollector(String luceneGroupField,
                                      Map result,
                                      org.apache.lucene.index.IndexReader indexReader)
Method Detail

collect

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

getHitCount

public long getHitCount()
Returns the number of times the collect(int, float) method was called. This should return the number of unique issues that was matched during a search.

Returns:
number of times the collect(int, float) method was called.


Copyright © 2002-2009 Atlassian. All Rights Reserved.