Show / Hide Table of Contents

    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 Source

    InfoStream

    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 Source

    GetBytes(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 s.

    FieldCache.IByteParser parser

    Computes for string values.

    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.

    | Improve this Doc View Source

    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 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, bool setDocsWithField)
    Parameters
    Type Name Description
    AtomicReader reader

    Used to get field values.

    System.String field

    Which field contains the single values.

    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.

    | Improve this Doc View Source

    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 .

    This is a Lucene.NET EXPERIMENTAL API, use at your own risk
    Declaration
    FieldCache.CacheEntry[] GetCacheEntries()
    Returns
    Type Description
    FieldCache.CacheEntry[]
    | Improve this Doc View Source

    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
    | Improve this Doc View Source

    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

    | Improve this Doc View Source

    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 s and returns an array of size 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 s.

    FieldCache.IDoubleParser parser

    Computes for string values. May be null if the requested field was indexed as NumericDocValuesField or DoubleField.

    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.

    | Improve this Doc View Source

    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
    GetDoubles(AtomicReader, String, FieldCache.IDoubleParser, Boolean)
    | Improve this Doc View Source

    GetInt16s(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 s.

    FieldCache.IInt16Parser parser

    Computes for string values.

    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.

    | Improve this Doc View Source

    GetInt16s(AtomicReader, String, Boolean)

    Checks the internal cache for an appropriate entry, and if none is found, reads the terms in field as s 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, bool setDocsWithField)
    Parameters
    Type Name Description
    AtomicReader reader

    Used to get field values.

    System.String field

    Which field contains the s.

    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.

    | Improve this Doc View Source

    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 s and returns an array of size 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 s.

    FieldCache.IInt32Parser parser

    Computes for string values. May be null if the requested field was indexed as NumericDocValuesField or Int32Field.

    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.

    | Improve this Doc View Source

    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
    GetInt32s(AtomicReader, String, FieldCache.IInt32Parser, Boolean)
    | Improve this Doc View Source

    GetInt64s(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 s and returns an array of size 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 s.

    FieldCache.IInt64Parser parser

    Computes for string values. May be null if the requested field was indexed as NumericDocValuesField or Int64Field.

    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.

    | Improve this Doc View Source

    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
    GetInt64s(AtomicReader, String, FieldCache.IInt64Parser, Boolean)
    | Improve this Doc View Source

    GetSingles(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 s and returns an array of size 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 s.

    FieldCache.ISingleParser parser

    Computes for string values. May be null if the requested field was indexed as NumericDocValuesField or SingleField.

    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.

    | Improve this Doc View Source

    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
    GetSingles(AtomicReader, String, FieldCache.ISingleParser, Boolean)
    | Improve this Doc View Source

    GetTerms(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.

    | Improve this Doc View Source

    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
    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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
    | Improve this Doc View Source

    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 s). It should not be relied on for "Cache maintenance" in general application code.

    This is a Lucene.NET EXPERIMENTAL API, use at your own risk
    Declaration
    void PurgeAllCaches()
    | Improve this Doc View Source

    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

    See Also

    FieldCacheSanityChecker
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)