@Internal
public abstract class AbstractOneDimensionalHitCollector
extends org.apache.lucene.search.Collector
Collector
which is a callback mechanism for use by
IndexSearcher
, but it is widely abused and called directly from within JIRA.Constructor and Description |
---|
AbstractOneDimensionalHitCollector(String documentFieldId,
FieldVisibilityManager fieldVisibilityManager,
ReaderCache readerCache,
FieldManager fieldManager) |
AbstractOneDimensionalHitCollector(String documentFieldId,
FieldVisibilityManager fieldVisibilityManager,
ReaderCache readerCache,
FieldManager fieldManager,
ProjectManager projectManager)
Deprecated.
Use
AbstractOneDimensionalHitCollector(String, FieldVisibilityManager, ReaderCache, FieldManager) instead. Since v6.4. |
AbstractOneDimensionalHitCollector(String documentFieldId,
org.apache.lucene.index.IndexReader indexReader,
FieldVisibilityManager fieldVisibilityManager,
ReaderCache readerCache,
FieldManager fieldManager,
ProjectManager projectManager)
Deprecated.
since v5.1.8. Use
AbstractOneDimensionalHitCollector(String, FieldVisibilityManager, ReaderCache,
FieldManager, ProjectManager)
and call setNextReader for each reader segment, that is if you are calling {@link #collect(int) directly
and not just passing the Collector to Lucene. |
Modifier and Type | Method and Description |
---|---|
boolean |
acceptsDocsOutOfOrder() |
void |
collect(int i)
Collect hits.
|
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) method was called. |
long |
getIrrelevantCount() |
void |
setNextReader(org.apache.lucene.index.IndexReader reader,
int docBase) |
void |
setScorer(org.apache.lucene.search.Scorer scorer) |
public AbstractOneDimensionalHitCollector(String documentFieldId, org.apache.lucene.index.IndexReader indexReader, FieldVisibilityManager fieldVisibilityManager, ReaderCache readerCache, FieldManager fieldManager, ProjectManager projectManager)
AbstractOneDimensionalHitCollector(String, FieldVisibilityManager, ReaderCache,
FieldManager, ProjectManager)
and call setNextReader for each reader segment, that is if you are calling {@link #collect(int) directly
and not just passing the Collector to Lucene.public AbstractOneDimensionalHitCollector(String documentFieldId, FieldVisibilityManager fieldVisibilityManager, ReaderCache readerCache, FieldManager fieldManager, ProjectManager projectManager)
AbstractOneDimensionalHitCollector(String, FieldVisibilityManager, ReaderCache, FieldManager)
instead. Since v6.4.public AbstractOneDimensionalHitCollector(String documentFieldId, FieldVisibilityManager fieldVisibilityManager, ReaderCache readerCache, FieldManager fieldManager)
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)
setNextReader
in class org.apache.lucene.search.Collector
public boolean acceptsDocsOutOfOrder()
acceptsDocsOutOfOrder
in class org.apache.lucene.search.Collector
public void collect(int i)
collect
in class org.apache.lucene.search.Collector
i
- Index to the current readerpublic long getIrrelevantCount()
public long getHitCount()
collect(int)
method was called. This should return the number of
unique issues that was matched during a search.collect(int)
method was called.protected abstract void collectIrrelevant(int docId)
docId
- the match we have found. This is an index into the overall directory reader.protected abstract void collectWithTerms(int docId, Collection<String> terms)
docId
- the doc id of the hit. This is an index into the overall directory reader.terms
- the terms for the fieldId for this document, pre-calculated so you may not need to call getDocumentCopyright © 2002-2015 Atlassian. All Rights Reserved.