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

java.lang.Object
  extended by org.apache.lucene.search.HitCollector
      extended by com.atlassian.jira.issue.statistics.util.AbstractOneDimensionalHitCollector
Direct Known Subclasses:
OneDimensionalDocIssueHitCollector, OneDimensionalTermHitCollector

public abstract class AbstractOneDimensionalHitCollector
extends org.apache.lucene.search.HitCollector

Used to traverse a query and collect if the specified one dimension is relevant, this will keep track of the irrelevant count.

Since:
v4.0

Constructor Summary
AbstractOneDimensionalHitCollector(String fieldId, org.apache.lucene.index.IndexReader indexReader, FieldVisibilityManager fieldVisibilityManager, ReaderCache readerCache)
           
 
Method Summary
 void collect(int i, float v)
           
protected abstract  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 abstract  void collectWithTerms(int docId, Collection<String> terms)
          Implement this if you would like to do something with the hit we have found.
 long getHitCount()
          Returns the number of times the collect(int, float) method was called.
 long getIrrelevantCount()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractOneDimensionalHitCollector

public AbstractOneDimensionalHitCollector(String fieldId,
                                          org.apache.lucene.index.IndexReader indexReader,
                                          FieldVisibilityManager fieldVisibilityManager,
                                          ReaderCache readerCache)
Method Detail

collect

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

getIrrelevantCount

public long getIrrelevantCount()

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.

collectIrrelevant

protected abstract 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

Parameters:
docId - the match we have found

collectWithTerms

protected abstract void collectWithTerms(int docId,
                                         Collection<String> terms)
Implement this if you would like to do something with the hit we have found.

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.