public interface FieldCache
Created: May 19, 2004 11:13:14 AM
FieldCacheSanityChecker| Modifier and Type | Interface and Description | 
|---|---|
| static interface  | FieldCache.ByteParserInterface to parse bytes from document fields. | 
| static class  | FieldCache.CacheEntryEXPERT: A unique Identifier/Description for each item in the FieldCache. | 
| static class  | FieldCache.CreationPlaceholder | 
| static interface  | FieldCache.DoubleParserInterface to parse doubles from document fields. | 
| static interface  | FieldCache.FloatParserInterface to parse floats from document fields. | 
| static interface  | FieldCache.IntParserInterface to parse ints from document fields. | 
| static interface  | FieldCache.LongParserInterface to parse long from document fields. | 
| static interface  | FieldCache.ParserMarker interface as super-interface to all parsers. | 
| static interface  | FieldCache.ShortParserInterface to parse shorts from document fields. | 
| static class  | FieldCache.StringIndexExpert: Stores term text values and document ordering data. | 
| Modifier and Type | Field and Description | 
|---|---|
| static FieldCache | DEFAULTExpert: The cache used internally by sorting and range query classes. | 
| static FieldCache.ByteParser | DEFAULT_BYTE_PARSERThe default parser for byte values, which are encoded by  Byte.toString(byte) | 
| static FieldCache.DoubleParser | DEFAULT_DOUBLE_PARSERThe default parser for double values, which are encoded by  Double.toString(double) | 
| static FieldCache.FloatParser | DEFAULT_FLOAT_PARSERThe default parser for float values, which are encoded by  Float.toString(float) | 
| static FieldCache.IntParser | DEFAULT_INT_PARSERThe default parser for int values, which are encoded by  Integer.toString(int) | 
| static FieldCache.LongParser | DEFAULT_LONG_PARSERThe default parser for long values, which are encoded by  Long.toString(long) | 
| static FieldCache.ShortParser | DEFAULT_SHORT_PARSERThe default parser for short values, which are encoded by  Short.toString(short) | 
| static FieldCache.DoubleParser | NUMERIC_UTILS_DOUBLE_PARSERA parser instance for double values encoded with  NumericUtils, e.g. | 
| static FieldCache.FloatParser | NUMERIC_UTILS_FLOAT_PARSERA parser instance for float values encoded with  NumericUtils, e.g. | 
| static FieldCache.IntParser | NUMERIC_UTILS_INT_PARSERA parser instance for int values encoded by  NumericUtils.intToPrefixCoded(int), e.g. | 
| static FieldCache.LongParser | NUMERIC_UTILS_LONG_PARSERA parser instance for long values encoded by  NumericUtils.longToPrefixCoded(long), e.g. | 
| static int | STRING_INDEXIndicator for StringIndex values in the cache. | 
| Modifier and Type | Method and Description | 
|---|---|
| byte[] | getBytes(IndexReader reader,
        String field)Checks the internal cache for an appropriate entry, and if none is
 found, reads the terms in  fieldas a single byte and returns an array
 of sizereader.maxDoc()of the value each document
 has in the given field. | 
| byte[] | getBytes(IndexReader reader,
        String field,
        FieldCache.ByteParser parser)Checks the internal cache for an appropriate entry, and if none is found,
 reads the terms in  fieldas bytes and returns an array of
 sizereader.maxDoc()of the value each document has in the
 given field. | 
| byte[] | getBytes(IndexReader reader,
        String field,
        FieldCache.ByteParser parser,
        boolean setDocsWithField)Checks the internal cache for an appropriate entry, and if none is found,
 reads the terms in  fieldas bytes and returns an array of
 sizereader.maxDoc()of the value each document has in the
 given field. | 
| FieldCache.CacheEntry[] | getCacheEntries()EXPERT: Generates an array of CacheEntry objects representing all items 
 currently in the FieldCache. | 
| Bits | getDocsWithField(IndexReader reader,
                String field)Checks the internal cache for an appropriate entry, and if none is found,
 reads the terms in  fieldand returns a bit set at the size ofreader.maxDoc(), with turned on bits for each docid that 
 does have a value for this field. | 
| double[] | getDoubles(IndexReader reader,
          String field)Checks the internal cache for an appropriate entry, and if none is
 found, reads the terms in  fieldas integers and returns an array
 of sizereader.maxDoc()of the value each document
 has in the given field. | 
| double[] | getDoubles(IndexReader reader,
          String field,
          FieldCache.DoubleParser parser)Checks the internal cache for an appropriate entry, and if none is found,
 reads the terms in  fieldas doubles and returns an array of
 sizereader.maxDoc()of the value each document has in the
 given field. | 
| double[] | getDoubles(IndexReader reader,
          String field,
          FieldCache.DoubleParser parser,
          boolean setDocsWithField)Checks the internal cache for an appropriate entry, and if none is found,
 reads the terms in  fieldas doubles and returns an array of
 sizereader.maxDoc()of the value each document has in the
 given field. | 
| float[] | getFloats(IndexReader reader,
         String field)Checks the internal cache for an appropriate entry, and if
 none is found, reads the terms in  fieldas floats and returns an array
 of sizereader.maxDoc()of the value each document
 has in the given field. | 
| float[] | getFloats(IndexReader reader,
         String field,
         FieldCache.FloatParser parser)Checks the internal cache for an appropriate entry, and if
 none is found, reads the terms in  fieldas floats and returns an array
 of sizereader.maxDoc()of the value each document
 has in the given field. | 
| float[] | getFloats(IndexReader reader,
         String field,
         FieldCache.FloatParser parser,
         boolean setDocsWithField)Checks the internal cache for an appropriate entry, and if
 none is found, reads the terms in  fieldas floats and returns an array
 of sizereader.maxDoc()of the value each document
 has in the given field. | 
| PrintStream | getInfoStream()counterpart of  setInfoStream(PrintStream) | 
| int[] | getInts(IndexReader reader,
       String field)Checks the internal cache for an appropriate entry, and if none is
 found, reads the terms in  fieldas integers and returns an array
 of sizereader.maxDoc()of the value each document
 has in the given field. | 
| int[] | getInts(IndexReader reader,
       String field,
       FieldCache.IntParser parser)Checks the internal cache for an appropriate entry, and if none is found,
 reads the terms in  fieldas integers and returns an array of
 sizereader.maxDoc()of the value each document has in the
 given field. | 
| int[] | getInts(IndexReader reader,
       String field,
       FieldCache.IntParser parser,
       boolean setDocsWithField)Checks the internal cache for an appropriate entry, and if none is found,
 reads the terms in  fieldas integers and returns an array of
 sizereader.maxDoc()of the value each document has in the
 given field. | 
| long[] | getLongs(IndexReader reader,
        String field)Checks the internal cache for an appropriate entry, and if none is
 found, reads the terms in  fieldas longs and returns an array
 of sizereader.maxDoc()of the value each document
 has in the given field. | 
| long[] | getLongs(IndexReader reader,
        String field,
        FieldCache.LongParser parser)Checks the internal cache for an appropriate entry, and if none is found,
 reads the terms in  fieldas longs and returns an array of
 sizereader.maxDoc()of the value each document has in the
 given field. | 
| long[] | getLongs(IndexReader reader,
        String field,
        FieldCache.LongParser parser,
        boolean setDocsWithField)Checks the internal cache for an appropriate entry, and if none is found,
 reads the terms in  fieldas longs and returns an array of
 sizereader.maxDoc()of the value each document has in the
 given field. | 
| short[] | getShorts(IndexReader reader,
         String field)Checks the internal cache for an appropriate entry, and if none is
 found, reads the terms in  fieldas shorts and returns an array
 of sizereader.maxDoc()of the value each document
 has in the given field. | 
| short[] | getShorts(IndexReader reader,
         String field,
         FieldCache.ShortParser parser)Checks the internal cache for an appropriate entry, and if none is found,
 reads the terms in  fieldas shorts and returns an array of
 sizereader.maxDoc()of the value each document has in the
 given field. | 
| short[] | getShorts(IndexReader reader,
         String field,
         FieldCache.ShortParser parser,
         boolean setDocsWithField)Checks the internal cache for an appropriate entry, and if none is found,
 reads the terms in  fieldas shorts and returns an array of
 sizereader.maxDoc()of the value each document has in the
 given field. | 
| FieldCache.StringIndex | getStringIndex(IndexReader reader,
              String field)Checks the internal cache for an appropriate entry, and if none
 is found reads the term values in  fieldand returns
 an array of them in natural order, along with an array telling
 which element in the term array each document uses. | 
| String[] | getStrings(IndexReader reader,
          String field)Checks the internal cache for an appropriate entry, and if none
 is found, reads the term values in  fieldand returns an array
 of sizereader.maxDoc()containing the value each document
 has in the given field. | 
| void | purge(IndexReader r)Expert: drops all cache entries associated with this
 reader. | 
| void | purgeAllCaches()
 EXPERT: Instructs the FieldCache to forcibly expunge all entries 
 from the underlying caches. | 
| void | setInfoStream(PrintStream stream)If non-null, FieldCacheImpl will warn whenever
 entries are created that are not sane according to
  FieldCacheSanityChecker. | 
static final int STRING_INDEX
static final FieldCache DEFAULT
static final FieldCache.ByteParser DEFAULT_BYTE_PARSER
Byte.toString(byte)static final FieldCache.ShortParser DEFAULT_SHORT_PARSER
Short.toString(short)static final FieldCache.IntParser DEFAULT_INT_PARSER
Integer.toString(int)static final FieldCache.FloatParser DEFAULT_FLOAT_PARSER
Float.toString(float)static final FieldCache.LongParser DEFAULT_LONG_PARSER
Long.toString(long)static final FieldCache.DoubleParser DEFAULT_DOUBLE_PARSER
Double.toString(double)static final FieldCache.IntParser NUMERIC_UTILS_INT_PARSER
NumericUtils.intToPrefixCoded(int), e.g. when indexed
 via NumericField/NumericTokenStream.static final FieldCache.FloatParser NUMERIC_UTILS_FLOAT_PARSER
NumericUtils, e.g. when indexed
 via NumericField/NumericTokenStream.static final FieldCache.LongParser NUMERIC_UTILS_LONG_PARSER
NumericUtils.longToPrefixCoded(long), e.g. when indexed
 via NumericField/NumericTokenStream.static final FieldCache.DoubleParser NUMERIC_UTILS_DOUBLE_PARSER
NumericUtils, e.g. when indexed
 via NumericField/NumericTokenStream.Bits getDocsWithField(IndexReader reader, String field) throws IOException
field and returns a bit set at the size of
 reader.maxDoc(), with turned on bits for each docid that 
 does have a value for this field.IOExceptionbyte[] getBytes(IndexReader reader, String field) throws IOException
field as a single byte and returns an array
 of size reader.maxDoc() of the value each document
 has in the given field.reader - Used to get field values.field - Which field contains the single byte values.IOException - If any error occurs.byte[] getBytes(IndexReader reader, String field, FieldCache.ByteParser parser) throws IOException
field as bytes and returns an array of
 size reader.maxDoc() of the value each document has in the
 given field.reader - Used to get field values.field - Which field contains the bytes.parser - Computes byte for string values.IOException - If any error occurs.byte[] getBytes(IndexReader reader, String field, FieldCache.ByteParser parser, boolean setDocsWithField) throws IOException
field as bytes and returns an array of
 size reader.maxDoc() of the value each document has in the
 given field.reader - Used to get field values.field - Which field contains the bytes.parser - Computes byte for string values.setDocsWithField - If true then getDocsWithField(org.apache.lucene.index.IndexReader, java.lang.String) will
        also be computed and stored in the FieldCache.IOException - If any error occurs.short[] getShorts(IndexReader reader, String field) throws IOException
field as shorts and returns an array
 of size reader.maxDoc() of the value each document
 has in the given field.reader - Used to get field values.field - Which field contains the shorts.IOException - If any error occurs.short[] getShorts(IndexReader reader, String field, FieldCache.ShortParser parser) throws IOException
field as shorts and returns an array of
 size reader.maxDoc() of the value each document has in the
 given field.reader - Used to get field values.field - Which field contains the shorts.parser - Computes short for string values.IOException - If any error occurs.short[] getShorts(IndexReader reader, String field, FieldCache.ShortParser parser, boolean setDocsWithField) throws IOException
field as shorts and returns an array of
 size reader.maxDoc() of the value each document has in the
 given field.reader - Used to get field values.field - Which field contains the shorts.parser - Computes short for string values.setDocsWithField - If true then getDocsWithField(org.apache.lucene.index.IndexReader, java.lang.String) will
        also be computed and stored in the FieldCache.IOException - If any error occurs.int[] getInts(IndexReader reader, String field) throws IOException
field as integers and returns an array
 of size reader.maxDoc() of the value each document
 has in the given field.reader - Used to get field values.field - Which field contains the integers.IOException - If any error occurs.int[] getInts(IndexReader reader, String field, FieldCache.IntParser parser) throws IOException
field as integers and returns an array of
 size reader.maxDoc() of the value each document has in the
 given field.reader - Used to get field values.field - Which field contains the integers.parser - Computes integer for string values.IOException - If any error occurs.int[] getInts(IndexReader reader, String field, FieldCache.IntParser parser, boolean setDocsWithField) throws IOException
field as integers and returns an array of
 size reader.maxDoc() of the value each document has in the
 given field.reader - Used to get field values.field - Which field contains the integers.parser - Computes integer for string values.setDocsWithField - If true then getDocsWithField(org.apache.lucene.index.IndexReader, java.lang.String) will
        also be computed and stored in the FieldCache.IOException - If any error occurs.float[] getFloats(IndexReader reader, String field) throws IOException
field as floats and returns an array
 of size reader.maxDoc() of the value each document
 has in the given field.reader - Used to get field values.field - Which field contains the floats.IOException - If any error occurs.float[] getFloats(IndexReader reader, String field, FieldCache.FloatParser parser) throws IOException
field as floats and returns an array
 of size reader.maxDoc() of the value each document
 has in the given field.reader - Used to get field values.field - Which field contains the floats.parser - Computes float for string values.IOException - If any error occurs.float[] getFloats(IndexReader reader, String field, FieldCache.FloatParser parser, boolean setDocsWithField) throws IOException
field as floats and returns an array
 of size reader.maxDoc() of the value each document
 has in the given field.reader - Used to get field values.field - Which field contains the floats.parser - Computes float for string values.setDocsWithField - If true then getDocsWithField(org.apache.lucene.index.IndexReader, java.lang.String) will
        also be computed and stored in the FieldCache.IOException - If any error occurs.long[] getLongs(IndexReader reader, String field) throws IOException
field as longs and returns an array
 of size reader.maxDoc() of the value each document
 has in the given field.reader - Used to get field values.field - Which field contains the longs.IOException - If any error occurs.long[] getLongs(IndexReader reader, String field, FieldCache.LongParser parser) throws IOException
field as longs and returns an array of
 size reader.maxDoc() of the value each document has in the
 given field.reader - Used to get field values.field - Which field contains the longs.parser - Computes integer for string values.IOException - If any error occurs.long[] getLongs(IndexReader reader, String field, FieldCache.LongParser parser, boolean setDocsWithField) throws IOException
field as longs and returns an array of
 size reader.maxDoc() of the value each document has in the
 given field.reader - Used to get field values.field - Which field contains the longs.parser - Computes integer for string values.setDocsWithField - If true then getDocsWithField(org.apache.lucene.index.IndexReader, java.lang.String) will
        also be computed and stored in the FieldCache.IOException - If any error occurs.double[] getDoubles(IndexReader reader, String field) throws IOException
field as integers and returns an array
 of size reader.maxDoc() of the value each document
 has in the given field.reader - Used to get field values.field - Which field contains the doubles.IOException - If any error occurs.double[] getDoubles(IndexReader reader, String field, FieldCache.DoubleParser parser) throws IOException
field as doubles and returns an array of
 size reader.maxDoc() of the value each document has in the
 given field.reader - Used to get field values.field - Which field contains the doubles.parser - Computes integer for string values.IOException - If any error occurs.double[] getDoubles(IndexReader reader, String field, FieldCache.DoubleParser parser, boolean setDocsWithField) throws IOException
field as doubles and returns an array of
 size reader.maxDoc() of the value each document has in the
 given field.reader - Used to get field values.field - Which field contains the doubles.parser - Computes integer for string values.setDocsWithField - If true then getDocsWithField(org.apache.lucene.index.IndexReader, java.lang.String) will
        also be computed and stored in the FieldCache.IOException - If any error occurs.String[] getStrings(IndexReader reader, String field) throws IOException
field and returns an array
 of size reader.maxDoc() containing the value each document
 has in the given field.reader - Used to get field values.field - Which field contains the strings.IOException - If any error occurs.FieldCache.StringIndex getStringIndex(IndexReader reader, String field) throws IOException
field and returns
 an array of them in natural order, along with an array telling
 which element in the term array each document uses.reader - Used to get field values.field - Which field contains the strings.IOException - If any error occurs.FieldCache.CacheEntry[] getCacheEntries()
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 WeakReference.
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.
void purge(IndexReader r)
void setInfoStream(PrintStream stream)
FieldCacheSanityChecker.PrintStream getInfoStream()
setInfoStream(PrintStream)