|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface FieldCache
Expert: Maintains caches of term values.
Created: May 19, 2004 11:13:14 AM
Nested Class Summary | |
---|---|
static interface |
FieldCache.ByteParser
Interface to parse bytes from document fields. |
static interface |
FieldCache.FloatParser
Interface to parse floats from document fields. |
static interface |
FieldCache.IntParser
Interface to parse ints from document fields. |
static interface |
FieldCache.ShortParser
Interface to parse shorts from document fields. |
static class |
FieldCache.StringIndex
Expert: Stores term text values and document ordering data. |
Field Summary | |
---|---|
static FieldCache |
DEFAULT
Expert: The cache used internally by sorting and range query classes. |
static int |
STRING_INDEX
Indicator for StringIndex values in the cache. |
Method Summary | |
---|---|
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. |
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. |
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 field as bytes and returns an array of
size reader.maxDoc() of the value each document has in the
given field. |
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. |
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. |
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 field as floats and returns an array
of size reader.maxDoc() of the value each document
has in the given field. |
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. |
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 field as integers and returns an array of
size reader.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 field as shorts and returns an array
of size reader.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 field as shorts and returns an array of
size reader.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 field and 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 field and returns an array
of size reader.maxDoc() containing the value each document
has in the given field. |
Field Detail |
---|
static final int STRING_INDEX
static final FieldCache DEFAULT
Method Detail |
---|
byte[] 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.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.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.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.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.Object getAuto(IndexReader reader, String field) throws IOException
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.
reader
- Used to get field values.field
- Which field contains the values.
IOException
- If any error occurs.Comparable[] getCustom(IndexReader reader, String field, SortComparator comparator) throws IOException
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.
reader
- Used to get field values.field
- Which field contains the values.comparator
- Used to convert terms into something to sort by.
IOException
- If any error occurs.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |