public class JiraLuceneFieldFinder extends Object
This has been refactored into a "finder" of terms values for fields within documents.
Constructor and Description |
---|
JiraLuceneFieldFinder() |
Modifier and Type | Method and Description |
---|---|
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.
|
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 ofIOException
- 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 findIOException
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 fieldIOException
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 forIOException
- 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 forIOException
- 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 termIOException
- if things dont play out well.Copyright © 2002-2018 Atlassian. All Rights Reserved.