|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.issue.search.parameters.lucene.sort.JiraLuceneFieldFinder
public class JiraLuceneFieldFinder
This used to be a cache of values but it was found that it consumed a hell of a lot of memory for no benefit (JRA-10111). So the cache.put was never called.
This has been refactored into a "finder" of terms values for fields within documents.
Constructor Summary | |
---|---|
JiraLuceneFieldFinder()
|
Method Summary | |
---|---|
boolean |
doesFieldContainTerm(org.apache.lucene.index.IndexReader reader,
String field,
String term)
This method checks if a field contains a term. |
Object[] |
getCustom(org.apache.lucene.index.IndexReader reader,
String field,
MappedSortComparator mappedSortComparator)
This is used to retrieve values from the Lucence index. |
static JiraLuceneFieldFinder |
getInstance()
|
Collection<String>[] |
getMatches(org.apache.lucene.index.IndexReader reader,
String field)
For each document in the index, it returns an array of string collections for each matching term. |
void |
getMatches(org.apache.lucene.index.IndexReader reader,
String field,
MatchHandler handler)
For each document that has at least one value defined for the specified field, invokes MatchHandler.handleMatchedDocument(int, String) with the document
index and the field value as the argument. |
List<String> |
getTermValuesForField(org.apache.lucene.index.IndexReader reader,
String field)
This method is used to retrieve term values form the Lucene index. |
List<String>[] |
getUniqueMatches(org.apache.lucene.index.IndexReader reader,
String field)
For each document in the index, it returns an array of string collections for each matching term. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JiraLuceneFieldFinder()
Method Detail |
---|
public static JiraLuceneFieldFinder getInstance()
public Object[] getCustom(org.apache.lucene.index.IndexReader reader, String field, MappedSortComparator mappedSortComparator) throws IOException
reader
- the Lucence index readerfield
- the name of the field to findmappedSortComparator
- the MappedSortComparator that we are acting on behalf of
IOException
- if things dont play out well.public List<String> getTermValuesForField(org.apache.lucene.index.IndexReader reader, String field) throws IOException
reader
- the Lucence index readerfield
- the name of the field to find
IOException
public boolean doesFieldContainTerm(org.apache.lucene.index.IndexReader reader, String field, String term) throws IOException
reader
- the Lucence index readerfield
- the name of the field to testterm
- the term you are looking for in the field
IOException
public Collection<String>[] getMatches(org.apache.lucene.index.IndexReader reader, String field) throws IOException
DefaultMatchHandler
.
reader
- the index to readfield
- the field to check the documents for
IOException
- if things dont play out well.@ExperimentalApi public List<String>[] getUniqueMatches(org.apache.lucene.index.IndexReader reader, String field) throws IOException
SingleValueMatchHandler
, so any collections that are returned are guaranteed
to contain exactly one (possibly null) value in them.
reader
- the index to readfield
- the field to check the documents for
IOException
- if things dont play out well.@ExperimentalApi public void getMatches(org.apache.lucene.index.IndexReader reader, String field, MatchHandler handler) throws IOException
MatchHandler.handleMatchedDocument(int, String)
with the document
index and the field value as the argument.
reader
- the index to readfield
- the field to check the documents forhandler
- a handler that will be invoked for each matching term
IOException
- if things dont play out well.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |