Class SharedFieldCache
- java.lang.Object
-
- org.apache.jackrabbit.core.query.lucene.SharedFieldCache
-
public class SharedFieldCache extends Object
Implements a variant of the lucene classorg.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SharedFieldCache.ValueIndex
Expert: Stores term text values and document ordering data.
-
Field Summary
Fields Modifier and Type Field Description static SharedFieldCache
INSTANCE
Reference to the single instance ofSharedFieldCache
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SharedFieldCache.ValueIndex
getValueIndex(IndexReader reader, String field, String prefix)
Creates aValueIndex
for afield
and a termprefix
.
-
-
-
Field Detail
-
INSTANCE
public static final SharedFieldCache INSTANCE
Reference to the single instance ofSharedFieldCache
.
-
-
Method Detail
-
getValueIndex
public SharedFieldCache.ValueIndex getValueIndex(IndexReader reader, String field, String prefix) throws IOException
Creates aValueIndex
for afield
and a termprefix
. The term prefix acts as the property name for the sharedfield
.This method is an adapted version of:
FieldCacheImpl.getStringIndex()
- Parameters:
reader
- theIndexReader
.field
- name of the shared field.prefix
- the property name, will be used as term prefix.- Returns:
- a ValueIndex that contains the field values and order information.
- Throws:
IOException
- if an error occurs while reading from the index.
-
-