org.apache.solr.search.function
Class OrdFieldSource
java.lang.Object
org.apache.solr.search.function.ValueSource
org.apache.solr.search.function.OrdFieldSource
- All Implemented Interfaces:
- java.io.Serializable
public class OrdFieldSource
- extends ValueSource
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.
- Version:
- $Id: OrdFieldSource.java 472574 2006-11-08 18:25:52Z yonik $
- Author:
- yonik
- See Also:
- Serialized Form
Field Summary |
protected java.lang.String |
field
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
field
protected java.lang.String field
OrdFieldSource
public OrdFieldSource(java.lang.String field)
description
public java.lang.String description()
- Description copied from class:
ValueSource
- description of field, used in explain()
- Specified by:
description
in class ValueSource
getValues
public DocValues getValues(org.apache.lucene.index.IndexReader reader)
throws java.io.IOException
- Specified by:
getValues
in class ValueSource
- Throws:
java.io.IOException
equals
public boolean equals(java.lang.Object o)
- Specified by:
equals
in class ValueSource
hashCode
public int hashCode()
- Specified by:
hashCode
in class ValueSource
Copyright © 2006 - 2008 The Apache Software Foundation