com.atlassian.jira.issue.search.parameters.lucene.sort
Class JiraLuceneFieldFinder

java.lang.Object
  extended by com.atlassian.jira.issue.search.parameters.lucene.sort.JiraLuceneFieldFinder

public class JiraLuceneFieldFinder
extends Object

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
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JiraLuceneFieldFinder

public JiraLuceneFieldFinder()
Method Detail

getInstance

public static JiraLuceneFieldFinder getInstance()

getCustom

public Object[] getCustom(org.apache.lucene.index.IndexReader reader,
                          String field,
                          MappedSortComparator mappedSortComparator)
                   throws IOException
This is used to retrieve values from the Lucence index. It returns an array that is the same size as the number of documents in the reader and will have all null values if the field is not present, otherwise it has the values of the field within the document.

Parameters:
reader - the Lucence index reader
field - the name of the field to find
mappedSortComparator - the MappedSortComparator that we are acting on behalf of
Returns:
an non null array of values, which may contain null values.
Throws:
IOException - if things dont play out well.

getMatches

public Collection<String>[] getMatches(org.apache.lucene.index.IndexReader reader,
                                       String field)
                                throws IOException
For each document in the index, it returns an array of string collections for each matching term.

Parameters:
reader - the index to read
field - the field to check the documents for
Returns:
an array of string collections for each term for each document
Throws:
IOException - if things dont play out well.


Copyright © 2002-2012 Atlassian. All Rights Reserved.