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.AbstractOneDimensionalHitCollector
          extended by com.atlassian.jira.issue.statistics.util.OneDimensionalTermHitCollector

public class OneDimensionalTermHitCollector
extends AbstractOneDimensionalHitCollector

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(java.lang.String fieldId, java.util.Map<java.lang.String,java.lang.Integer> result, org.apache.lucene.index.IndexReader indexReader, FieldVisibilityManager fieldVisibilityManager, ReaderCache readerCache)
           
 
Method Summary
protected  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 match
protected  void collectWithTerms(int docId, java.util.Collection<java.lang.String> 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, getHitCount, getIrrelevantCount
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OneDimensionalTermHitCollector

public OneDimensionalTermHitCollector(java.lang.String fieldId,
                                      java.util.Map<java.lang.String,java.lang.Integer> result,
                                      org.apache.lucene.index.IndexReader indexReader,
                                      FieldVisibilityManager fieldVisibilityManager,
                                      ReaderCache readerCache)
Method Detail

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 class AbstractOneDimensionalHitCollector
Parameters:
docId - the match we have found

collectWithTerms

protected void collectWithTerms(int docId,
                                java.util.Collection<java.lang.String> terms)
Description copied from class: AbstractOneDimensionalHitCollector
Implement this if you would like to do something with the hit we have found.

Specified by:
collectWithTerms in class AbstractOneDimensionalHitCollector
Parameters:
docId - the doc id of the hit
terms - the terms for the fieldId for this document, pre-calculated so you may not need to call getDocument


Copyright © 2002-2010 Atlassian. All Rights Reserved.