Class SharedFieldCache

  extended by org.apache.jackrabbit.core.query.lucene.SharedFieldCache

public class SharedFieldCache
extends Object

Implements a variant of the lucene class 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
static class SharedFieldCache.ValueIndex
          Expert: Stores term text values and document ordering data.
Field Summary
static SharedFieldCache INSTANCE
          Reference to the single instance of SharedFieldCache.
Method Summary
 SharedFieldCache.ValueIndex getValueIndex(org.apache.lucene.index.IndexReader reader, String field, String prefix, comparator)
          Creates a ValueIndex for a field and a term prefix.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail


public static final SharedFieldCache INSTANCE
Reference to the single instance of SharedFieldCache.

Method Detail


public SharedFieldCache.ValueIndex getValueIndex(org.apache.lucene.index.IndexReader reader,
                                                 String field,
                                                 String prefix,
                                          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()

reader - the IndexReader.
field - name of the shared field.
prefix - the property name, will be used as term prefix.
comparator - the sort comparator instance.
a ValueIndex that contains the field values and order information.
IOException - if an error occurs while reading from the index.

Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.