Home » lucene-3.0.1-src » org.apache » lucene » search » [javadoc | source]
org.apache.lucene.search
public interface: FieldCache [javadoc | source]

All Known Implementing Classes:
    ExtendedFieldCacheImpl, ExtendedFieldCache, FieldCacheImpl

Expert: Maintains caches of term values.

Created: May 19, 2004 11:13:14 AM

Nested Class Summary:
public static final class  FieldCache.CreationPlaceholder   
public static class  FieldCache.StringIndex  Expert: Stores term text values and document ordering data. 
public interface  FieldCache.Parser  Marker interface as super-interface to all parsers. It is used to specify a custom parser to {@link SortField#SortField(String, FieldCache.Parser)}. 
public interface  FieldCache.ByteParser  Interface to parse bytes from document fields. 
public interface  FieldCache.ShortParser  Interface to parse shorts from document fields. 
public interface  FieldCache.IntParser  Interface to parse ints from document fields. 
public interface  FieldCache.FloatParser  Interface to parse floats from document fields. 
public interface  FieldCache.LongParser  Interface to parse long from document fields. 
public interface  FieldCache.DoubleParser  Interface to parse doubles from document fields. 
abstract public static class  FieldCache.CacheEntry  EXPERT: A unique Identifier/Description for each item in the FieldCache. Can be useful for logging/debugging.

EXPERIMENTAL API: This API is considered extremely advanced and experimental. It may be removed or altered w/o warning in future releases of Lucene.

 
Field Summary
public static final  int STRING_INDEX    Indicator for StringIndex values in the cache. 
public static  FieldCache DEFAULT    Expert: The cache used internally by sorting and range query classes. 
public static final  ByteParser DEFAULT_BYTE_PARSER    The default parser for byte values, which are encoded by Byte#toString(byte)  
public static final  ShortParser DEFAULT_SHORT_PARSER    The default parser for short values, which are encoded by Short#toString(short)  
public static final  IntParser DEFAULT_INT_PARSER    The default parser for int values, which are encoded by Integer#toString(int)  
public static final  FloatParser DEFAULT_FLOAT_PARSER    The default parser for float values, which are encoded by Float#toString(float)  
public static final  LongParser DEFAULT_LONG_PARSER    The default parser for long values, which are encoded by Long#toString(long)  
public static final  DoubleParser DEFAULT_DOUBLE_PARSER    The default parser for double values, which are encoded by Double#toString(double)  
public static final  IntParser NUMERIC_UTILS_INT_PARSER    A parser instance for int values encoded by NumericUtils#intToPrefixCoded(int) , e.g. when indexed via NumericField /NumericTokenStream
public static final  FloatParser NUMERIC_UTILS_FLOAT_PARSER    A parser instance for float values encoded with NumericUtils , e.g. when indexed via NumericField /NumericTokenStream
public static final  LongParser NUMERIC_UTILS_LONG_PARSER    A parser instance for long values encoded by NumericUtils#longToPrefixCoded(long) , e.g. when indexed via NumericField /NumericTokenStream
public static final  DoubleParser NUMERIC_UTILS_DOUBLE_PARSER    A parser instance for double values encoded with NumericUtils , e.g. when indexed via NumericField /NumericTokenStream
Method from org.apache.lucene.search.FieldCache Summary:
getBytes,   getBytes,   getCacheEntries,   getDoubles,   getDoubles,   getFloats,   getFloats,   getInfoStream,   getInts,   getInts,   getLongs,   getLongs,   getShorts,   getShorts,   getStringIndex,   getStrings,   purgeAllCaches,   setInfoStream
Method from org.apache.lucene.search.FieldCache Detail:
 public byte[] getBytes(IndexReader reader,
    String field) throws IOException
    Checks the internal cache for an appropriate entry, and if none is found, reads the terms in field as a single byte and returns an array of size reader.maxDoc() of the value each document has in the given field.
 public byte[] getBytes(IndexReader reader,
    String field,
    ByteParser parser) throws IOException
    Checks the internal cache for an appropriate entry, and if none is found, reads the terms in field as bytes and returns an array of size reader.maxDoc() of the value each document has in the given field.
 abstract public CacheEntry[] getCacheEntries()
    EXPERT: Generates an array of CacheEntry objects representing all items currently in the FieldCache.

    NOTE: These CacheEntry objects maintain a strong reference to the Cached Values. Maintaining references to a CacheEntry the IndexReader associated with it has garbage collected will prevent the Value itself from being garbage collected when the Cache drops the WeakRefrence.

    EXPERIMENTAL API: This API is considered extremely advanced and experimental. It may be removed or altered w/o warning in future releases of Lucene.

 public double[] getDoubles(IndexReader reader,
    String field) throws IOException
    Checks the internal cache for an appropriate entry, and if none is found, reads the terms in field as integers and returns an array of size reader.maxDoc() of the value each document has in the given field.
 public double[] getDoubles(IndexReader reader,
    String field,
    DoubleParser parser) throws IOException
    Checks the internal cache for an appropriate entry, and if none is found, reads the terms in field as doubles and returns an array of size reader.maxDoc() of the value each document has in the given field.
 public float[] getFloats(IndexReader reader,
    String field) throws IOException
    Checks the internal cache for an appropriate entry, and if none is found, reads the terms in field as floats and returns an array of size reader.maxDoc() of the value each document has in the given field.
 public float[] getFloats(IndexReader reader,
    String field,
    FloatParser parser) throws IOException
    Checks the internal cache for an appropriate entry, and if none is found, reads the terms in field as floats and returns an array of size reader.maxDoc() of the value each document has in the given field.
 public PrintStream getInfoStream()
 public int[] getInts(IndexReader reader,
    String field) throws IOException
    Checks the internal cache for an appropriate entry, and if none is found, reads the terms in field as integers and returns an array of size reader.maxDoc() of the value each document has in the given field.
 public int[] getInts(IndexReader reader,
    String field,
    IntParser parser) throws IOException
    Checks the internal cache for an appropriate entry, and if none is found, reads the terms in field as integers and returns an array of size reader.maxDoc() of the value each document has in the given field.
 public long[] getLongs(IndexReader reader,
    String field) throws IOException
    Checks the internal cache for an appropriate entry, and if none is found, reads the terms in field as longs and returns an array of size reader.maxDoc() of the value each document has in the given field.
 public long[] getLongs(IndexReader reader,
    String field,
    LongParser parser) throws IOException
    Checks the internal cache for an appropriate entry, and if none is found, reads the terms in field as longs and returns an array of size reader.maxDoc() of the value each document has in the given field.
 public short[] getShorts(IndexReader reader,
    String field) throws IOException
    Checks the internal cache for an appropriate entry, and if none is found, reads the terms in field as shorts and returns an array of size reader.maxDoc() of the value each document has in the given field.
 public short[] getShorts(IndexReader reader,
    String field,
    ShortParser parser) throws IOException
    Checks the internal cache for an appropriate entry, and if none is found, reads the terms in field as shorts and returns an array of size reader.maxDoc() of the value each document has in the given field.
 public StringIndex getStringIndex(IndexReader reader,
    String field) throws IOException
    Checks the internal cache for an appropriate entry, and if none is found reads the term values in field and returns an array of them in natural order, along with an array telling which element in the term array each document uses.
 public String[] getStrings(IndexReader reader,
    String field) throws IOException
    Checks the internal cache for an appropriate entry, and if none is found, reads the term values in field and returns an array of size reader.maxDoc() containing the value each document has in the given field.
 abstract public  void purgeAllCaches()

    EXPERT: Instructs the FieldCache to forcibly expunge all entries from the underlying caches. This is intended only to be used for test methods as a way to ensure a known base state of the Cache (with out needing to rely on GC to free WeakReferences). It should not be relied on for "Cache maintenance" in general application code.

    EXPERIMENTAL API: This API is considered extremely advanced and experimental. It may be removed or altered w/o warning in future releases of Lucene.

 public  void setInfoStream(PrintStream stream)