Namespace Lucene.Net.Expressions
expressions
Expression - result of compiling an expression, which can evaluate it for a given document. Each expression can have external variables are resolved by {@code Bindings}.
Bindings - abstraction for binding external variables to a way to get a value for those variables for a particular document (ValueSource).
SimpleBindings - default implementation of bindings which provide easy ways to bind sort fields and other expressions to external variables
Classes
Bindings
Binds variable names in expressions to actual data.
Expression
Base class that computes the value of an expression for a document.
SimpleBindings
Simple class that binds expression variable names to 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));
This is a Lucene.NET EXPERIMENTAL API, use at your own risk