| org.apache.lucene.search.FieldCache
All known Subclasses: org.apache.lucene.search.FieldCacheImpl,
FieldCache | public interface FieldCache (Code) | | Expert: Maintains caches of term values.
Created: May 19, 2004 11:13:14 AM
author: Tim Jones (Nacimiento Software) since: lucene 1.4 version: $Id: FieldCache.java 544546 2007-06-05 16:29:35Z doronc $ |
Inner Class :public static class StringIndex | |
Inner Class :public interface ByteParser | |
Inner Class :public interface ShortParser | |
Inner Class :public interface IntParser | |
Inner Class :public interface FloatParser | |
Field Summary | |
public static FieldCache | DEFAULT Expert: The cache used internally by sorting and range query classes. | final public static int | STRING_INDEX Indicator for StringIndex values in the cache. |
Method Summary | |
public Object | getAuto(IndexReader reader, String field) Checks the internal cache for an appropriate entry, and if
none is found reads field to see if it contains integers, floats
or strings, and then calls one of the other methods in this class to get the
values. | public byte[] | getBytes(IndexReader reader, String field) 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.
Parameters: reader - Used to get field values. Parameters: field - Which field contains the single byte values. | public byte[] | getBytes(IndexReader reader, String field, ByteParser parser) 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.
Parameters: reader - Used to get field values. Parameters: field - Which field contains the bytes. Parameters: parser - Computes byte for string values. | public Comparable[] | getCustom(IndexReader reader, String field, SortComparator comparator) Checks the internal cache for an appropriate entry, and if none
is found reads the terms out of field and calls the given SortComparator
to get the sort values. | public float[] | getFloats(IndexReader reader, String field) 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.
Parameters: reader - Used to get field values. Parameters: field - Which field contains the floats. | public float[] | getFloats(IndexReader reader, String field, FloatParser parser) 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.
Parameters: reader - Used to get field values. Parameters: field - Which field contains the floats. Parameters: parser - Computes float for string values. | public int[] | getInts(IndexReader reader, String field) 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.
Parameters: reader - Used to get field values. Parameters: field - Which field contains the integers. | public int[] | getInts(IndexReader reader, String field, IntParser parser) 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.
Parameters: reader - Used to get field values. Parameters: field - Which field contains the integers. Parameters: parser - Computes integer for string values. | public short[] | getShorts(IndexReader reader, String field) 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.
Parameters: reader - Used to get field values. Parameters: field - Which field contains the shorts. | public short[] | getShorts(IndexReader reader, String field, ShortParser parser) 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.
Parameters: reader - Used to get field values. Parameters: field - Which field contains the shorts. Parameters: parser - Computes short for string values. | public StringIndex | getStringIndex(IndexReader reader, String field) 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.
Parameters: reader - Used to get field values. Parameters: field - Which field contains the strings. | public String[] | getStrings(IndexReader reader, String field) 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.
Parameters: reader - Used to get field values. Parameters: field - Which field contains the strings. |
DEFAULT | public static FieldCache DEFAULT(Code) | | Expert: The cache used internally by sorting and range query classes.
|
STRING_INDEX | final public static int STRING_INDEX(Code) | | Indicator for StringIndex values in the cache.
|
getAuto | public Object getAuto(IndexReader reader, String field) throws IOException(Code) | | Checks the internal cache for an appropriate entry, and if
none is found reads field to see if it contains integers, floats
or strings, and then calls one of the other methods in this class to get the
values. For string values, a StringIndex is returned. After
calling this method, there is an entry in the cache for both
type AUTO and the actual found type.
Parameters: reader - Used to get field values. Parameters: field - Which field contains the values. int[], float[] or StringIndex. throws: IOException - If any error occurs. |
getBytes | public byte[] getBytes(IndexReader reader, String field) throws IOException(Code) | | 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.
Parameters: reader - Used to get field values. Parameters: field - Which field contains the single byte values. The values in the given field for each document. throws: IOException - If any error occurs. |
getBytes | public byte[] getBytes(IndexReader reader, String field, ByteParser parser) throws IOException(Code) | | 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.
Parameters: reader - Used to get field values. Parameters: field - Which field contains the bytes. Parameters: parser - Computes byte for string values. The values in the given field for each document. throws: IOException - If any error occurs. |
getCustom | public Comparable[] getCustom(IndexReader reader, String field, SortComparator comparator) throws IOException(Code) | | Checks the internal cache for an appropriate entry, and if none
is found reads the terms out of field and calls the given SortComparator
to get the sort values. A hit in the cache will happen if reader ,
field , and comparator are the same (using equals() )
as a previous call to this method.
Parameters: reader - Used to get field values. Parameters: field - Which field contains the values. Parameters: comparator - Used to convert terms into something to sort by. Array of sort objects, one for each document. throws: IOException - If any error occurs. |
getFloats | public float[] getFloats(IndexReader reader, String field) throws IOException(Code) | | 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.
Parameters: reader - Used to get field values. Parameters: field - Which field contains the floats. The values in the given field for each document. throws: IOException - If any error occurs. |
getFloats | public float[] getFloats(IndexReader reader, String field, FloatParser parser) throws IOException(Code) | | 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.
Parameters: reader - Used to get field values. Parameters: field - Which field contains the floats. Parameters: parser - Computes float for string values. The values in the given field for each document. throws: IOException - If any error occurs. |
getInts | public int[] getInts(IndexReader reader, String field) throws IOException(Code) | | 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.
Parameters: reader - Used to get field values. Parameters: field - Which field contains the integers. The values in the given field for each document. throws: IOException - If any error occurs. |
getInts | public int[] getInts(IndexReader reader, String field, IntParser parser) throws IOException(Code) | | 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.
Parameters: reader - Used to get field values. Parameters: field - Which field contains the integers. Parameters: parser - Computes integer for string values. The values in the given field for each document. throws: IOException - If any error occurs. |
getShorts | public short[] getShorts(IndexReader reader, String field) throws IOException(Code) | | 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.
Parameters: reader - Used to get field values. Parameters: field - Which field contains the shorts. The values in the given field for each document. throws: IOException - If any error occurs. |
getShorts | public short[] getShorts(IndexReader reader, String field, ShortParser parser) throws IOException(Code) | | 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.
Parameters: reader - Used to get field values. Parameters: field - Which field contains the shorts. Parameters: parser - Computes short for string values. The values in the given field for each document. throws: IOException - If any error occurs. |
getStringIndex | public StringIndex getStringIndex(IndexReader reader, String field) throws IOException(Code) | | 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.
Parameters: reader - Used to get field values. Parameters: field - Which field contains the strings. Array of terms and index into the array for each document. throws: IOException - If any error occurs. |
getStrings | public String[] getStrings(IndexReader reader, String field) throws IOException(Code) | | 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.
Parameters: reader - Used to get field values. Parameters: field - Which field contains the strings. The values in the given field for each document. throws: IOException - If any error occurs. |
|
|