Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class DocumentValueSourceDictionary

    Dictionary with terms and optionally payload information taken from stored fields in a Lucene index. Similar to DocumentDictionary, except it obtains the weight of the terms in a document based on a Lucene.Net.Queries.Function.ValueSource.

    NOTE:
    • The term and (optionally) payload fields have to be stored
    • if the term or (optionally) payload fields supplied do not have a value for a document, then the document is rejected by the dictionary

    In practice the Lucene.Net.Queries.Function.ValueSource will likely be obtained using the lucene expression module. The following example shows how to create a Lucene.Net.Queries.Function.ValueSource from a simple addition of two fields:

    Expression expression = JavascriptCompiler.Compile("f1 + f2");
     SimpleBindings bindings = new SimpleBindings();
     bindings.Add(new SortField("f1", SortField.Type_e.LONG));
     bindings.Add(new SortField("f2", SortField.Type_e.LONG));
     ValueSource valueSource = expression.GetValueSource(bindings);
    Inheritance
    object
    DocumentDictionary
    DocumentValueSourceDictionary
    Implements
    IDictionary
    Inherited Members
    DocumentDictionary.m_reader
    DocumentDictionary.m_payloadField
    DocumentDictionary.m_contextsField
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Lucene.Net.Search.Suggest
    Assembly: Lucene.Net.Suggest.dll
    Syntax
    public class DocumentValueSourceDictionary : DocumentDictionary, IDictionary

    Constructors

    DocumentValueSourceDictionary(IndexReader, string, ValueSource)

    Creates a new dictionary with the contents of the fields named field for the terms and uses the weightsValueSource supplied to determine the score.

    Declaration
    public DocumentValueSourceDictionary(IndexReader reader, string field, ValueSource weightsValueSource)
    Parameters
    Type Name Description
    IndexReader reader
    string field
    ValueSource weightsValueSource

    DocumentValueSourceDictionary(IndexReader, string, ValueSource, string)

    Creates a new dictionary with the contents of the fields named field for the terms, payload for the corresponding payloads and uses the weightsValueSource supplied to determine the score.

    Declaration
    public DocumentValueSourceDictionary(IndexReader reader, string field, ValueSource weightsValueSource, string payload)
    Parameters
    Type Name Description
    IndexReader reader
    string field
    ValueSource weightsValueSource
    string payload

    DocumentValueSourceDictionary(IndexReader, string, ValueSource, string, string)

    Creates a new dictionary with the contents of the fields named field for the terms, payload for the corresponding payloads, contexts for the associated contexts and uses the weightsValueSource supplied to determine the score.

    Declaration
    public DocumentValueSourceDictionary(IndexReader reader, string field, ValueSource weightsValueSource, string payload, string contexts)
    Parameters
    Type Name Description
    IndexReader reader
    string field
    ValueSource weightsValueSource
    string payload
    string contexts

    Methods

    GetEntryEnumerator()

    Returns an enumerator over all the entries.

    Declaration
    public override IInputEnumerator GetEntryEnumerator()
    Returns
    Type Description
    IInputEnumerator

    Enumerator

    Overrides
    DocumentDictionary.GetEntryEnumerator()

    Implements

    IDictionary
    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.