Class FieldComparer.TermOrdValComparer
Sorts by field's natural Term sort order, using ordinals. This is functionally equivalent to FieldComparer.TermValComparer, but it first resolves the string to their relative ordinal positions (using the index returned by GetTermsIndex(AtomicReader, String, Single)), and does most comparisons using the ordinals. For medium to large results, this comparer will be much faster than FieldComparer.TermValComparer. For very small result sets it may be slower.
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Lucene.Net.Search
Assembly: Lucene.Net.dll
Syntax
public class TermOrdValComparer : FieldComparer<BytesRef>
Constructors
| Improve this Doc View SourceTermOrdValComparer(Int32, String)
Creates this, sorting missing values first.
Declaration
public TermOrdValComparer(int numHits, string field)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | numHits | |
System.String | field |
TermOrdValComparer(Int32, String, Boolean)
Creates this, with control over how missing values
are sorted. Pass true for sortMissingLast
to put
missing values at the end.
Declaration
public TermOrdValComparer(int numHits, string field, bool sortMissingLast)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | numHits | |
System.String | field | |
System.Boolean | sortMissingLast |
Properties
| Improve this Doc View SourceItem[Int32]
Declaration
public override IComparable this[int slot] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | slot |
Property Value
Type | Description |
---|---|
System.IComparable |
Overrides
Methods
| Improve this Doc View SourceCompare(Int32, Int32)
Declaration
public override int Compare(int slot1, int slot2)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | slot1 | |
System.Int32 | slot2 |
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
Lucene.Net.Search.FieldComparer<Lucene.Net.Util.BytesRef>.Compare(System.Int32, System.Int32)
|
Improve this Doc
View Source
CompareBottom(Int32)
Declaration
public override int CompareBottom(int doc)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | doc |
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
Lucene.Net.Search.FieldComparer<Lucene.Net.Util.BytesRef>.CompareBottom(System.Int32)
|
Improve this Doc
View Source
CompareTop(Int32)
Declaration
public override int CompareTop(int doc)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | doc |
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
Lucene.Net.Search.FieldComparer<Lucene.Net.Util.BytesRef>.CompareTop(System.Int32)
|
Improve this Doc
View Source
CompareValues(BytesRef, BytesRef)
Declaration
public override int CompareValues(BytesRef val1, BytesRef val2)
Parameters
Type | Name | Description |
---|---|---|
BytesRef | val1 | |
BytesRef | val2 |
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
Lucene.Net.Search.FieldComparer<Lucene.Net.Util.BytesRef>.CompareValues(Lucene.Net.Util.BytesRef, Lucene.Net.Util.BytesRef)
|
Improve this Doc
View Source
Copy(Int32, Int32)
Declaration
public override void Copy(int slot, int doc)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | slot | |
System.Int32 | doc |
Overrides
Lucene.Net.Search.FieldComparer<Lucene.Net.Util.BytesRef>.Copy(System.Int32, System.Int32)
|
Improve this Doc
View Source
GetSortedDocValues(AtomicReaderContext, String)
Retrieves the SortedDocValues for the field in this segment
Declaration
protected virtual SortedDocValues GetSortedDocValues(AtomicReaderContext context, string field)
Parameters
Type | Name | Description |
---|---|---|
AtomicReaderContext | context | |
System.String | field |
Returns
Type | Description |
---|---|
SortedDocValues |
SetBottom(Int32)
Declaration
public override void SetBottom(int slot)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | slot |
Overrides
Lucene.Net.Search.FieldComparer<Lucene.Net.Util.BytesRef>.SetBottom(System.Int32)
|
Improve this Doc
View Source
SetNextReader(AtomicReaderContext)
Declaration
public override FieldComparer SetNextReader(AtomicReaderContext context)
Parameters
Type | Name | Description |
---|---|---|
AtomicReaderContext | context |
Returns
Type | Description |
---|---|
FieldComparer |
Overrides
Lucene.Net.Search.FieldComparer<Lucene.Net.Util.BytesRef>.SetNextReader(Lucene.Net.Index.AtomicReaderContext)
|
Improve this Doc
View Source
SetTopValue(Object)
Declaration
public override void SetTopValue(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value |
Overrides
Lucene.Net.Search.FieldComparer<Lucene.Net.Util.BytesRef>.SetTopValue(System.Object)