public class

MappedSortComparator

extends FieldComparatorSource
java.lang.Object
   ↳ org.apache.lucene.search.FieldComparatorSource
     ↳ com.atlassian.jira.issue.search.parameters.lucene.sort.MappedSortComparator

Class Overview

This Sort Comparator uses a mixed strategy to retrieve the term values. If we are retrieving less thatn 1% of the documents in the index, we get each document value individually. Once passed the 1% threshhold however we switch to reading through the terms dictionary in lucene, and builds up a list of ordered terms. It then sorts the documents according to the order that they appear in the terms list. This latter approach, whilst very fast, does load the entire term dictionary into memory, and allocates a slot for every document value, which is why we do not use it all the time. We believe that most searches in very large JIRA installations will return a very small portion of the document index, either because they are over only one of many projects or they return only open issues, especially on dashboards and in GreenHopper and similar plugins as well as in general navigator searches.

Summary

Nested Classes
class MappedSortComparator.InternalFieldComparator  
Public Constructors
MappedSortComparator(LuceneFieldSorter sorter)
Public Methods
boolean equals(Object o)
Object getComparable(String termtext)
Returns an object which, when sorted according by the comparator returned from getComparator() , will order the Term values in the correct order.
Comparator getComparator()
int hashCode()
FieldComparator newComparator(String fieldname, int numHits, int sortPos, boolean reversed)
[Expand]
Inherited Methods
From class org.apache.lucene.search.FieldComparatorSource
From class java.lang.Object

Public Constructors

public MappedSortComparator (LuceneFieldSorter sorter)

Public Methods

public boolean equals (Object o)

public Object getComparable (String termtext)

Returns an object which, when sorted according by the comparator returned from getComparator() , will order the Term values in the correct order.

For example, if the Terms contained integer values, this method would return new Integer(termtext). Note that this might not always be the most efficient implementation - for this particular example, a better implementation might be to make a ScoreDocLookupComparator that uses an internal lookup table of int.

Parameters
termtext The textual value of the term.
Returns

public Comparator getComparator ()

public int hashCode ()

public FieldComparator newComparator (String fieldname, int numHits, int sortPos, boolean reversed)

Throws
IOException