com.atlassian.confluence.search.lucene
Class CaseInsensitiveSortComparator
java.lang.Object
org.apache.lucene.search.SortComparator
com.atlassian.confluence.search.lucene.CaseInsensitiveSortComparator
- All Implemented Interfaces:
- Serializable, SortComparatorSource
public class CaseInsensitiveSortComparator
- extends SortComparator
A Lucene SortComparator that will convert field text to lower case effectively rendering all comparisons case
insensitive.
- See Also:
- Serialized Form
CaseInsensitiveSortComparator
public CaseInsensitiveSortComparator()
getComparable
protected Comparable getComparable(String fieldText)
- Specified by:
getComparable
in class SortComparator
equals
public boolean equals(Object obj)
Since the comparator used has no actual 'user' data we only want one of them cached so equals is just based on
class.
This is very important. Otherwise Lucene will cache a new comparator for each search/sort performed.
Since each comparator has a field cache for it's respective field you will quickly run out of memory.
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- See the
equals(Object)
implementation for explanation.
- Overrides:
hashCode
in class Object