![]() |
Lucene.Net
3.0.3
Lucene.Net is a .NET port of the Java Lucene Indexing Library
|
Expert: obtains the ordinal of the field value from the default Lucene Fieldcache using getStringIndex(). The native lucene index order is used to assign an ordinal value for each field value. Field values (terms) are lexicographically ordered by unicode value, and numbered starting at 1. Example:
If there were only three field values: "apple","banana","pear"
then ord("apple")=1, ord("banana")=2, ord("pear")=3 WARNING: ord() depends on the position in an index and can thus change when other documents are inserted or deleted, or if a MultiSearcher is used.
More...
Inherits Lucene.Net.Search.Function.ValueSource.
Public Member Functions | |
OrdFieldSource (System.String field) | |
Constructor for a certain field. | |
override System.String | Description () |
description of field, used in explain() | |
override DocValues | GetValues (IndexReader reader) |
Return the DocValues used by the function query. | |
override bool | Equals (System.Object o) |
Needed for possible caching of query results - used by ValueSourceQuery.Equals(Object). | |
override int | GetHashCode () |
Needed for possible caching of query results - used by ValueSourceQuery.GetHashCode(). | |
![]() | |
override System.String | ToString () |
Expert: obtains the ordinal of the field value from the default Lucene Fieldcache using getStringIndex().
The native lucene index order is used to assign an ordinal value for each field value.
Field values (terms) are lexicographically ordered by unicode value, and numbered starting at 1.
Example:
If there were only three field values: "apple","banana","pear"
then ord("apple")=1, ord("banana")=2, ord("pear")=3
WARNING: ord() depends on the position in an index and can thus change when other documents are inserted or deleted, or if a MultiSearcher is used.
<font color="#FF0000"> WARNING: The status of the Search.Function package is experimental. The APIs introduced here might change in the future and will not be supported anymore in such a case.</font>
NOTE: with the switch in 2.9 to segment-based searching, if GetValues is invoked with a composite (multi-segment) reader, this can easily cause double RAM usage for the values in the FieldCache. It's best to switch your application to pass only atomic (single segment) readers to this API.
Definition at line 56 of file OrdFieldSource.cs.
Lucene.Net.Search.Function.OrdFieldSource.OrdFieldSource | ( | System.String | field | ) |
Constructor for a certain field.
field | field whose values order is used. |
Definition at line 107 of file OrdFieldSource.cs.
|
virtual |
description of field, used in explain()
Implements Lucene.Net.Search.Function.ValueSource.
Definition at line 113 of file OrdFieldSource.cs.
|
virtual |
Needed for possible caching of query results - used by ValueSourceQuery.Equals(Object).
Implements Lucene.Net.Search.Function.ValueSource.
Definition at line 126 of file OrdFieldSource.cs.
|
virtual |
Needed for possible caching of query results - used by ValueSourceQuery.GetHashCode().
Implements Lucene.Net.Search.Function.ValueSource.
Definition at line 137 of file OrdFieldSource.cs.
|
virtual |
Return the DocValues used by the function query.
reader | the IndexReader used to read these values. If any caching is involved, that caching would also be IndexReader based. |
<throws> IOException for any error. </throws>
Implements Lucene.Net.Search.Function.ValueSource.
Definition at line 119 of file OrdFieldSource.cs.