com.atlassian.confluence.search.lucene
Class CaseInsensitiveSortComparator
java.lang.Object
org.apache.lucene.search.SortComparator
com.atlassian.confluence.search.lucene.CaseInsensitiveSortComparator
- All Implemented Interfaces:
- java.io.Serializable, org.apache.lucene.search.SortComparatorSource
public class CaseInsensitiveSortComparator
- extends org.apache.lucene.search.SortComparator
A Lucene SortComparator that will convert field text to lower case effectively rendering all comparisons case
insensitive.
- See Also:
- Serialized Form
Method Summary |
boolean |
equals(java.lang.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. |
protected java.lang.Comparable |
getComparable(java.lang.String fieldText)
|
int |
hashCode()
See the equals(Object) implementation for explanation. |
Methods inherited from class org.apache.lucene.search.SortComparator |
newComparator |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
CaseInsensitiveSortComparator
public CaseInsensitiveSortComparator()
getComparable
protected java.lang.Comparable getComparable(java.lang.String fieldText)
- Specified by:
getComparable
in class org.apache.lucene.search.SortComparator
equals
public boolean equals(java.lang.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 java.lang.Object
hashCode
public int hashCode()
- See the
equals(Object)
implementation for explanation.
- Overrides:
hashCode
in class java.lang.Object
Copyright © 2003-2011 Atlassian. All Rights Reserved.