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 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 ValueSource will likely be obtained using the lucene expression module. The following example shows how to create a 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
    System.Object
    DocumentDictionary
    DocumentValueSourceDictionary
    Implements
    IDictionary
    Inherited Members
    DocumentDictionary.m_reader
    DocumentDictionary.m_payloadField
    DocumentDictionary.m_contextsField
    Namespace: Lucene.Net.Search.Suggest
    Assembly: Lucene.Net.Suggest.dll
    Syntax
    public class DocumentValueSourceDictionary : DocumentDictionary, IDictionary

    Constructors

    | Improve this Doc View Source

    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
    System.String field
    ValueSource weightsValueSource
    | Improve this Doc View Source

    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
    System.String field
    ValueSource weightsValueSource
    System.String payload
    | Improve this Doc View Source

    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
    System.String field
    ValueSource weightsValueSource
    System.String payload
    System.String contexts

    Methods

    | Improve this Doc View Source

    GetEntryIterator()

    Declaration
    public override IInputIterator GetEntryIterator()
    Returns
    Type Description
    IInputIterator
    Overrides
    DocumentDictionary.GetEntryIterator()

    Implements

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