Interface IFieldCache
Expert: Maintains caches of term values.
Created: May 19, 2004 11:13:14 AM
@lucene.internal
@since lucene 1.4
Namespace: Lucene.Net.Search
Assembly: Lucene.Net.dll
Syntax
public interface IFieldCache
Properties
| Improve this Doc View SourceInfoStream
If non-null, Lucene.Net.Search.FieldCacheImpl will warn whenever entries are created that are not sane according to FieldCacheSanityChecker.
Declaration
TextWriter InfoStream { get; set; }
Property Value
Type | Description |
---|---|
TextWriter |
Methods
| Improve this Doc View SourceGetBytes(AtomicReader, String, FieldCache.IByteParser, Boolean)
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.
Declaration
FieldCache.Bytes GetBytes(AtomicReader reader, string field, FieldCache.IByteParser parser, bool setDocsWithField)
Parameters
Type | Name | Description |
---|---|---|
AtomicReader | reader | Used to get field values. |
System.String | field | Which field contains the |
FieldCache.IByteParser | parser | Computes |
System.Boolean | setDocsWithField | If true then GetDocsWithField(AtomicReader, String) will also be computed and stored in the IFieldCache. |
Returns
Type | Description |
---|---|
FieldCache.Bytes | The values in the given field for each document. |
GetBytes(AtomicReader, String, Boolean)
Checks the internal cache for an appropriate entry, and if none is
found, reads the terms in field
as a single reader.MaxDoc
of the value each document
has in the given field.
Declaration
FieldCache.Bytes GetBytes(AtomicReader reader, string field, bool setDocsWithField)
Parameters
Type | Name | Description |
---|---|---|
AtomicReader | reader | Used to get field values. |
System.String | field | Which field contains the single |
System.Boolean | setDocsWithField | If true then GetDocsWithField(AtomicReader, String) will also be computed and stored in the IFieldCache. |
Returns
Type | Description |
---|---|
FieldCache.Bytes | The values in the given field for each document. |
GetCacheEntries()
EXPERT: Generates an array of FieldCache.CacheEntry objects representing all items currently in the IFieldCache.
NOTE: These FieldCache.CacheEntry objects maintain a strong reference to the
Cached Values. Maintaining references to a FieldCache.CacheEntry the AtomicReader
associated with it has garbage collected will prevent the Value itself
from being garbage collected when the Cache drops the
Declaration
FieldCache.CacheEntry[] GetCacheEntries()
Returns
Type | Description |
---|---|
FieldCache.CacheEntry[] |
GetDocsWithField(AtomicReader, String)
Checks the internal cache for an appropriate entry, and if none is found,
reads the terms in 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.
Declaration
IBits GetDocsWithField(AtomicReader reader, string field)
Parameters
Type | Name | Description |
---|---|---|
AtomicReader | reader | |
System.String | field |
Returns
Type | Description |
---|---|
IBits |
GetDocTermOrds(AtomicReader, String)
Checks the internal cache for an appropriate entry, and if none is found, reads the term values
in field
and returns a SortedSetDocValues instance, providing a method to retrieve
the terms (as ords) per document.
Declaration
SortedSetDocValues GetDocTermOrds(AtomicReader reader, string field)
Parameters
Type | Name | Description |
---|---|---|
AtomicReader | reader | Used to build a SortedSetDocValues instance |
System.String | field | Which field contains the strings. |
Returns
Type | Description |
---|---|
SortedSetDocValues | a SortedSetDocValues instance |
GetDoubles(AtomicReader, String, FieldCache.IDoubleParser, Boolean)
Returns a FieldCache.Doubles over the values found in documents in the given
field. If the field was indexed as NumericDocValuesField, it simply
uses GetNumericDocValues(String) to read the values.
Otherwise, it checks the internal cache for an appropriate entry, and if
none is found, reads the terms in field
as reader.MaxDoc
of the value each document
has in the given field.
Declaration
FieldCache.Doubles GetDoubles(AtomicReader reader, string field, FieldCache.IDoubleParser parser, bool setDocsWithField)
Parameters
Type | Name | Description |
---|---|---|
AtomicReader | reader | Used to get field values. |
System.String | field | Which field contains the |
FieldCache.IDoubleParser | parser | Computes |
System.Boolean | setDocsWithField | If true then GetDocsWithField(AtomicReader, String) will also be computed and stored in the IFieldCache. |
Returns
Type | Description |
---|---|
FieldCache.Doubles | The values in the given field for each document. |
GetDoubles(AtomicReader, String, Boolean)
Returns a FieldCache.Doubles over the values found in documents in the given field.
Declaration
FieldCache.Doubles GetDoubles(AtomicReader reader, string field, bool setDocsWithField)
Parameters
Type | Name | Description |
---|---|---|
AtomicReader | reader | |
System.String | field | |
System.Boolean | setDocsWithField |
Returns
Type | Description |
---|---|
FieldCache.Doubles |
See Also
| Improve this Doc View SourceGetInt16s(AtomicReader, String, FieldCache.IInt16Parser, Boolean)
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.
NOTE: this was getShorts() in Lucene
Declaration
FieldCache.Int16s GetInt16s(AtomicReader reader, string field, FieldCache.IInt16Parser parser, bool setDocsWithField)
Parameters
Type | Name | Description |
---|---|---|
AtomicReader | reader | Used to get field values. |
System.String | field | Which field contains the |
FieldCache.IInt16Parser | parser | Computes |
System.Boolean | setDocsWithField | If true then GetDocsWithField(AtomicReader, String) will also be computed and stored in the IFieldCache. |
Returns
Type | Description |
---|---|
FieldCache.Int16s | The values in the given field for each document. |
GetInt16s(AtomicReader, String, Boolean)
Checks the internal cache for an appropriate entry, and if none is
found, reads the terms in field
as reader.MaxDoc
of the value each document
has in the given field.
NOTE: this was getShorts() in Lucene
Declaration
FieldCache.Int16s GetInt16s(AtomicReader reader, string field, bool setDocsWithField)
Parameters
Type | Name | Description |
---|---|---|
AtomicReader | reader | Used to get field values. |
System.String | field | Which field contains the |
System.Boolean | setDocsWithField | If true then GetDocsWithField(AtomicReader, String) will also be computed and stored in the IFieldCache. |
Returns
Type | Description |
---|---|
FieldCache.Int16s | The values in the given field for each document. |
GetInt32s(AtomicReader, String, FieldCache.IInt32Parser, Boolean)
Returns an FieldCache.Int32s over the values found in documents in the given
field. If the field was indexed as NumericDocValuesField, it simply
uses GetNumericDocValues(String) to read the values.
Otherwise, it checks the internal cache for an appropriate entry, and if
none is found, reads the terms in field
as reader.MaxDoc
of the value each document
has in the given field.
NOTE: this was getInts() in Lucene
Declaration
FieldCache.Int32s GetInt32s(AtomicReader reader, string field, FieldCache.IInt32Parser parser, bool setDocsWithField)
Parameters
Type | Name | Description |
---|---|---|
AtomicReader | reader | Used to get field values. |
System.String | field | Which field contains the |
FieldCache.IInt32Parser | parser | Computes |
System.Boolean | setDocsWithField | If true then GetDocsWithField(AtomicReader, String) will also be computed and stored in the IFieldCache. |
Returns
Type | Description |
---|---|
FieldCache.Int32s | The values in the given field for each document. |
GetInt32s(AtomicReader, String, Boolean)
Returns an FieldCache.Int32s over the values found in documents in the given field.
NOTE: this was getInts() in Lucene
Declaration
FieldCache.Int32s GetInt32s(AtomicReader reader, string field, bool setDocsWithField)
Parameters
Type | Name | Description |
---|---|---|
AtomicReader | reader | |
System.String | field | |
System.Boolean | setDocsWithField |
Returns
Type | Description |
---|---|
FieldCache.Int32s |
See Also
| Improve this Doc View SourceGetInt64s(AtomicReader, String, FieldCache.IInt64Parser, Boolean)
Returns a FieldCache.Int64s over the values found in documents in the given
field. If the field was indexed as NumericDocValuesField, it simply
uses GetNumericDocValues(String) to read the values.
Otherwise, it checks the internal cache for an appropriate entry, and if
none is found, reads the terms in field
as reader.MaxDoc
of the value each document
has in the given field.
NOTE: this was getLongs() in Lucene
Declaration
FieldCache.Int64s GetInt64s(AtomicReader reader, string field, FieldCache.IInt64Parser parser, bool setDocsWithField)
Parameters
Type | Name | Description |
---|---|---|
AtomicReader | reader | Used to get field values. |
System.String | field | Which field contains the |
FieldCache.IInt64Parser | parser | Computes |
System.Boolean | setDocsWithField | If true then GetDocsWithField(AtomicReader, String) will also be computed and stored in the IFieldCache. |
Returns
Type | Description |
---|---|
FieldCache.Int64s | The values in the given field for each document. |
GetInt64s(AtomicReader, String, Boolean)
Returns a FieldCache.Int64s over the values found in documents in the given field.
NOTE: this was getLongs() in Lucene
Declaration
FieldCache.Int64s GetInt64s(AtomicReader reader, string field, bool setDocsWithField)
Parameters
Type | Name | Description |
---|---|---|
AtomicReader | reader | |
System.String | field | |
System.Boolean | setDocsWithField |
Returns
Type | Description |
---|---|
FieldCache.Int64s |
See Also
| Improve this Doc View SourceGetSingles(AtomicReader, String, FieldCache.ISingleParser, Boolean)
Returns a FieldCache.Singles over the values found in documents in the given
field. If the field was indexed as NumericDocValuesField, it simply
uses GetNumericDocValues(String) to read the values.
Otherwise, it checks the internal cache for an appropriate entry, and if
none is found, reads the terms in field
as reader.MaxDoc
of the value each document
has in the given field.
NOTE: this was getFloats() in Lucene
Declaration
FieldCache.Singles GetSingles(AtomicReader reader, string field, FieldCache.ISingleParser parser, bool setDocsWithField)
Parameters
Type | Name | Description |
---|---|---|
AtomicReader | reader | Used to get field values. |
System.String | field | Which field contains the |
FieldCache.ISingleParser | parser | Computes |
System.Boolean | setDocsWithField | If true then GetDocsWithField(AtomicReader, String) will also be computed and stored in the IFieldCache. |
Returns
Type | Description |
---|---|
FieldCache.Singles | The values in the given field for each document. |
GetSingles(AtomicReader, String, Boolean)
Returns a FieldCache.Singles over the values found in documents in the given field.
NOTE: this was getFloats() in Lucene
Declaration
FieldCache.Singles GetSingles(AtomicReader reader, string field, bool setDocsWithField)
Parameters
Type | Name | Description |
---|---|---|
AtomicReader | reader | |
System.String | field | |
System.Boolean | setDocsWithField |
Returns
Type | Description |
---|---|
FieldCache.Singles |
See Also
| Improve this Doc View SourceGetTerms(AtomicReader, String, Boolean)
Checks the internal cache for an appropriate entry, and if none
is found, reads the term values in field
and returns a BinaryDocValues instance, providing a
method to retrieve the term (as a BytesRef) per document.
Declaration
BinaryDocValues GetTerms(AtomicReader reader, string field, bool setDocsWithField)
Parameters
Type | Name | Description |
---|---|---|
AtomicReader | reader | Used to get field values. |
System.String | field | Which field contains the strings. |
System.Boolean | setDocsWithField | If true then GetDocsWithField(AtomicReader, String) will also be computed and stored in the IFieldCache. |
Returns
Type | Description |
---|---|
BinaryDocValues | The values in the given field for each document. |
GetTerms(AtomicReader, String, Boolean, Single)
Expert: just like GetTerms(AtomicReader, String, Boolean), but you can specify whether more RAM should be consumed in exchange for faster lookups (default is "true"). Note that the first call for a given reader and field "wins", subsequent calls will share the same cache entry.
Declaration
BinaryDocValues GetTerms(AtomicReader reader, string field, bool setDocsWithField, float acceptableOverheadRatio)
Parameters
Type | Name | Description |
---|---|---|
AtomicReader | reader | |
System.String | field | |
System.Boolean | setDocsWithField | |
System.Single | acceptableOverheadRatio |
Returns
Type | Description |
---|---|
BinaryDocValues |
GetTermsIndex(AtomicReader, String)
Checks the internal cache for an appropriate entry, and if none
is found, reads the term values in field
and returns a SortedDocValues instance,
providing methods to retrieve sort ordinals and terms
(as a BytesRef) per document.
Declaration
SortedDocValues GetTermsIndex(AtomicReader reader, string field)
Parameters
Type | Name | Description |
---|---|---|
AtomicReader | reader | Used to get field values. |
System.String | field | Which field contains the strings. |
Returns
Type | Description |
---|---|
SortedDocValues | The values in the given field for each document. |
GetTermsIndex(AtomicReader, String, Single)
Expert: just like GetTermsIndex(AtomicReader, String), but you can specify whether more RAM should be consumed in exchange for faster lookups (default is "true"). Note that the first call for a given reader and field "wins", subsequent calls will share the same cache entry.
Declaration
SortedDocValues GetTermsIndex(AtomicReader reader, string field, float acceptableOverheadRatio)
Parameters
Type | Name | Description |
---|---|---|
AtomicReader | reader | |
System.String | field | |
System.Single | acceptableOverheadRatio |
Returns
Type | Description |
---|---|
SortedDocValues |
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
Declaration
void PurgeAllCaches()
PurgeByCacheKey(Object)
Expert: drops all cache entries associated with this reader CoreCacheKey. NOTE: this cache key must precisely match the reader that the cache entry is keyed on. If you pass a top-level reader, it usually will have no effect as Lucene now caches at the segment reader level.
Declaration
void PurgeByCacheKey(object coreCacheKey)
Parameters
Type | Name | Description |
---|---|---|
System.Object | coreCacheKey |