org.apache.solr.search.function
Class ReverseOrdFieldSource
java.lang.Object
org.apache.solr.search.function.ValueSource
org.apache.solr.search.function.ReverseOrdFieldSource
- All Implemented Interfaces:
- java.io.Serializable
public class ReverseOrdFieldSource
- extends ValueSource
Obtains the ordinal of the field value from the default Lucene FieldCache
using getStringIndex()
and reverses the order.
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 of reverse ordinal (rord):
If there were only three field values: "apple","banana","pear"
then rord("apple")=3, rord("banana")=2, ord("pear")=1
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: ReverseOrdFieldSource.java 472574 2006-11-08 18:25:52Z yonik $
- Author:
- yonik
- See Also:
- Serialized Form
Field Summary |
java.lang.String |
field
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
field
public java.lang.String field
ReverseOrdFieldSource
public ReverseOrdFieldSource(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 - 2009 The Apache Software Foundation