Class SimpleBindings


  • public final class SimpleBindings
    extends Bindings
    Simple class that binds expression variable names to DoubleValuesSources or other Expressions.

    Example usage:

       SimpleBindings bindings = new SimpleBindings();
       // document's text relevance score
       bindings.add("_score", DoubleValuesSource.SCORES);
       // integer NumericDocValues field
       bindings.add("popularity", DoubleValuesSource.fromIntField("popularity"));
       // another expression
       bindings.add("recency", myRecencyExpression);
    
       // create a sort field in reverse order
       Sort sort = new Sort(expr.getSortField(bindings, true));
     
    WARNING: This API is experimental and might change in incompatible ways in the next release.
    • Constructor Detail

      • SimpleBindings

        public SimpleBindings()
        Creates a new empty Bindings