org.apache.jackrabbit.core.query.lucene
Class SharedFieldCache
java.lang.Object
org.apache.jackrabbit.core.query.lucene.SharedFieldCache
public class SharedFieldCache
- extends Object
Implements a variant of the lucene class org.apache.lucene.search.FieldCacheImpl
.
The lucene FieldCache class has some sort of support for custom comparators
but it only works on the basis of a field name. There is no further control
over the terms to iterate, that's why we use our own implementation.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
INSTANCE
public static final SharedFieldCache INSTANCE
- Reference to the single instance of
SharedFieldCache
.
getValueIndex
public SharedFieldCache.ValueIndex getValueIndex(org.apache.lucene.index.IndexReader reader,
String field,
String prefix,
org.apache.lucene.search.SortComparator comparator)
throws IOException
- Creates a
ValueIndex
for a field
and a term
prefix
. The term prefix acts as the property name for the
shared field
.
This method is an adapted version of: FieldCacheImpl.getStringIndex()
- Parameters:
reader
- the IndexReader
.field
- name of the shared field.prefix
- the property name, will be used as term prefix.comparator
- the sort comparator instance.
- Returns:
- a ValueIndex that contains the field values and order
information.
- Throws:
IOException
- if an error occurs while reading from the index.
Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.