public static final class AlfrescoSolrDataModel.TermOrdValComparator
extends org.apache.lucene.search.FieldComparator<org.apache.lucene.util.BytesRef>
FieldComparator.TermValComparator, but it first resolves the string
to their relative ordinal positions (using the index
returned by FieldCache.getTermsIndex(org.apache.lucene.index.AtomicReader, java.lang.String)), and
does most comparisons using the ordinals. For medium
to large results, this comparator will be much faster
than FieldComparator.TermValComparator. For very small
result sets it may be slower.org.apache.lucene.search.FieldComparator.ByteComparator, org.apache.lucene.search.FieldComparator.DocComparator, org.apache.lucene.search.FieldComparator.DoubleComparator, org.apache.lucene.search.FieldComparator.FloatComparator, org.apache.lucene.search.FieldComparator.IntComparator, org.apache.lucene.search.FieldComparator.LongComparator, org.apache.lucene.search.FieldComparator.NumericComparator<T extends Number>, org.apache.lucene.search.FieldComparator.RelevanceComparator, org.apache.lucene.search.FieldComparator.ShortComparator, org.apache.lucene.search.FieldComparator.TermOrdValComparator, org.apache.lucene.search.FieldComparator.TermValComparator| Constructor and Description |
|---|
TermOrdValComparator(int numHits,
String field)
Creates this, sorting missing values first.
|
TermOrdValComparator(int numHits,
String field,
boolean sortMissingLast)
Creates this, with control over how missing values
are sorted.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compare(int slot1,
int slot2) |
int |
compareBottom(int doc) |
int |
compareTop(int doc) |
int |
compareValues(org.apache.lucene.util.BytesRef val1,
org.apache.lucene.util.BytesRef val2) |
void |
copy(int slot,
int doc) |
void |
setBottom(int bottom) |
org.apache.lucene.search.FieldComparator<org.apache.lucene.util.BytesRef> |
setNextReader(org.apache.lucene.index.AtomicReaderContext context) |
void |
setTopValue(org.apache.lucene.util.BytesRef value) |
org.apache.lucene.util.BytesRef |
value(int slot) |
public TermOrdValComparator(int numHits,
String field)
public TermOrdValComparator(int numHits,
String field,
boolean sortMissingLast)
public int compare(int slot1,
int slot2)
compare in class org.apache.lucene.search.FieldComparator<org.apache.lucene.util.BytesRef>public int compareBottom(int doc)
compareBottom in class org.apache.lucene.search.FieldComparator<org.apache.lucene.util.BytesRef>public void copy(int slot,
int doc)
copy in class org.apache.lucene.search.FieldComparator<org.apache.lucene.util.BytesRef>public org.apache.lucene.search.FieldComparator<org.apache.lucene.util.BytesRef> setNextReader(org.apache.lucene.index.AtomicReaderContext context)
throws IOException
setNextReader in class org.apache.lucene.search.FieldComparator<org.apache.lucene.util.BytesRef>IOExceptionpublic void setBottom(int bottom)
setBottom in class org.apache.lucene.search.FieldComparator<org.apache.lucene.util.BytesRef>public void setTopValue(org.apache.lucene.util.BytesRef value)
setTopValue in class org.apache.lucene.search.FieldComparator<org.apache.lucene.util.BytesRef>public org.apache.lucene.util.BytesRef value(int slot)
value in class org.apache.lucene.search.FieldComparator<org.apache.lucene.util.BytesRef>public int compareTop(int doc)
compareTop in class org.apache.lucene.search.FieldComparator<org.apache.lucene.util.BytesRef>public int compareValues(org.apache.lucene.util.BytesRef val1,
org.apache.lucene.util.BytesRef val2)
compareValues in class org.apache.lucene.search.FieldComparator<org.apache.lucene.util.BytesRef>Copyright © 2005–2017 Alfresco Software. All rights reserved.