Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class SimpleBindings

    Simple class that binds expression variable names to Lucene.Net.Search.SortFields or other Expressions.

    Example usage:

    SimpleBindings bindings = new SimpleBindings();
    // document's text relevance score
    bindings.Add(new SortField("_score", SortFieldType.SCORE));
    // integer NumericDocValues field (or from FieldCache)
    bindings.Add(new SortField("popularity", SortFieldType.INT));
    // another expression
    bindings.Add("recency", myRecencyExpression);
    // create a sort field in reverse order
    Sort sort = new Sort(expr.GetSortField(bindings, true));
    Note

    This API is experimental and might change in incompatible ways in the next release.

    Inheritance
    System.Object
    Bindings
    SimpleBindings
    Inherited Members
    Bindings.GetScoreValueSource()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Lucene.Net.Expressions
    Assembly: Lucene.Net.Expressions.dll
    Syntax
    public sealed class SimpleBindings : Bindings

    Constructors

    | Improve this Doc View Source

    SimpleBindings()

    Creates a new empty Bindings

    Declaration
    public SimpleBindings()

    Methods

    | Improve this Doc View Source

    Add(SortField)

    Adds a Lucene.Net.Search.SortField to the bindings.

    Declaration
    public void Add(SortField sortField)
    Parameters
    Type Name Description
    Lucene.Net.Search.SortField sortField
    Remarks

    Adds a Lucene.Net.Search.SortField to the bindings.

    This can be used to reference a DocValuesField, a field from FieldCache, the document's score, etc.

    | Improve this Doc View Source

    Add(String, Expression)

    Adds an Expression to the bindings.

    Declaration
    public void Add(string name, Expression expression)
    Parameters
    Type Name Description
    System.String name
    Expression expression
    Remarks

    Adds an Expression to the bindings.

    This can be used to reference expressions from other expressions.

    | Improve this Doc View Source

    GetValueSource(String)

    Declaration
    public override ValueSource GetValueSource(string name)
    Parameters
    Type Name Description
    System.String name
    Returns
    Type Description
    Lucene.Net.Queries.Function.ValueSource
    Overrides
    Bindings.GetValueSource(String)
    | Improve this Doc View Source

    Validate()

    Traverses the graph of bindings, checking there are no cycles or missing references

    Declaration
    public void Validate()
    Exceptions
    Type Condition
    System.ArgumentException

    if the bindings is inconsistent

    • Improve this Doc
    • View Source
    Back to top Copyright © 2021 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.