blob: 00be73e74ef731d1be040b62cc152c3174d85642 [file] [log] [blame]
{
"Lucene.Net.Expressions.Bindings.html": {
"href": "Lucene.Net.Expressions.Bindings.html",
"title": "Class Bindings | Apache Lucene.NET 4.8.0-beta00010 Documentation",
"keywords": "Class Bindings Binds variable names in expressions to actual data. Inheritance System.Object Bindings SimpleBindings Inherited Members 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 abstract class Bindings Remarks Binds variable names in expressions to actual data. These are typically DocValues fields/FieldCache, the document's relevance score, or other Lucene.Net.Queries.Function.ValueSource s. This is a Lucene.NET EXPERIMENTAL API, use at your own risk Constructors | Improve this Doc View Source Bindings() Sole constructor. Declaration public Bindings() Remarks Sole constructor. (For invocation by subclass constructors, typically implicit.) Methods | Improve this Doc View Source GetScoreValueSource() Returns a Lucene.Net.Queries.Function.ValueSource over relevance scores Declaration protected ValueSource GetScoreValueSource() Returns Type Description Lucene.Net.Queries.Function.ValueSource | Improve this Doc View Source GetValueSource(String) Returns a Lucene.Net.Queries.Function.ValueSource bound to the variable name. Declaration public abstract ValueSource GetValueSource(string name) Parameters Type Name Description System.String name Returns Type Description Lucene.Net.Queries.Function.ValueSource"
},
"Lucene.Net.Expressions.Expression.html": {
"href": "Lucene.Net.Expressions.Expression.html",
"title": "Class Expression | Apache Lucene.NET 4.8.0-beta00010 Documentation",
"keywords": "Class Expression Base class that computes the value of an expression for a document. Inheritance System.Object Expression Inherited Members 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 abstract class Expression Remarks Base class that computes the value of an expression for a document. Example usage: // compile an expression: Expression expr = JavascriptCompiler.Compile(\"sqrt(_score) + ln(popularity)\"); // SimpleBindings just maps variables to SortField instances SimpleBindings bindings = new SimpleBindings(); bindings.Add(new SortField(\"_score\", SortFieldType.SCORE)); bindings.Add(new SortField(\"popularity\", SortFieldType.INT)); // create a sort field and sort by it (reverse order) Sort sort = new Sort(expr.GetSortField(bindings, true)); Query query = new TermQuery(new Term(\"body\", \"contents\")); searcher.Search(query, null, 10, sort); This is a Lucene.NET EXPERIMENTAL API, use at your own risk Constructors | Improve this Doc View Source Expression(String, String[]) Creates a new Expression . Declaration public Expression(string sourceText, string[] variables) Parameters Type Name Description System.String sourceText Source text for the expression: e.g. ln(popularity) System.String [] variables Names of external variables referred to by the expression Properties | Improve this Doc View Source SourceText The original source text Declaration public string SourceText { get; } Property Value Type Description System.String | Improve this Doc View Source Variables Named variables referred to by this expression Declaration public string[] Variables { get; } Property Value Type Description System.String [] Methods | Improve this Doc View Source Evaluate(Int32, FunctionValues[]) Evaluates the expression for the given document. Declaration public abstract double Evaluate(int document, FunctionValues[] functionValues) Parameters Type Name Description System.Int32 document docId of the document to compute a value for Lucene.Net.Queries.Function.FunctionValues [] functionValues Lucene.Net.Queries.Function.FunctionValues for each element of Variables . Returns Type Description System.Double The computed value of the expression for the given document. Remarks Evaluates the expression for the given document. | Improve this Doc View Source GetRescorer(Bindings) Get a Lucene.Net.Search.Rescorer , to rescore first-pass hits using this expression. Declaration public virtual Rescorer GetRescorer(Bindings bindings) Parameters Type Name Description Bindings bindings Returns Type Description Lucene.Net.Search.Rescorer | Improve this Doc View Source GetSortField(Bindings, Boolean) Get a sort field which can be used to rank documents by this expression. Declaration public virtual SortField GetSortField(Bindings bindings, bool reverse) Parameters Type Name Description Bindings bindings System.Boolean reverse Returns Type Description Lucene.Net.Search.SortField Remarks Get a sort field which can be used to rank documents by this expression. | Improve this Doc View Source GetValueSource(Bindings) Get a value source which can compute the value of this expression in the context of the given bindings. Declaration public virtual ValueSource GetValueSource(Bindings bindings) Parameters Type Name Description Bindings bindings Bindings to use for external values in this expression Returns Type Description Lucene.Net.Queries.Function.ValueSource A value source which will evaluate this expression when used Remarks Get a value source which can compute the value of this expression in the context of the given bindings. See Also Compile(String)"
},
"Lucene.Net.Expressions.html": {
"href": "Lucene.Net.Expressions.html",
"title": "Namespace Lucene.Net.Expressions | Apache Lucene.NET 4.8.0-beta00010 Documentation",
"keywords": "Namespace Lucene.Net.Expressions <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> 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 Lucene.Net.Search.SortField s or other Expression s. 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"
},
"Lucene.Net.Expressions.JS.html": {
"href": "Lucene.Net.Expressions.JS.html",
"title": "Namespace Lucene.Net.Expressions.JS | Apache Lucene.NET 4.8.0-beta00010 Documentation",
"keywords": "Namespace Lucene.Net.Expressions.JS <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> Javascript expressions A Javascript expression is a numeric expression specified using an expression syntax that's based on JavaScript expressions. You can construct expressions using: Integer, floating point, hex and octal literals Arithmetic operators: + - * / % Bitwise operators: | & ^ ~ << >> >>> Boolean operators (including the ternary operator): && || ! ?: Comparison operators: < <= == >= > Common mathematic functions: abs ceil exp floor ln log2 log10 logn max min sqrt pow Trigonometric library functions: acosh acos asinh asin atanh atan atan2 cosh cos sinh sin tanh tan Distance functions: haversin Miscellaneous functions: min, max Arbitrary external variables - see Bindings JavaScript order of precedence rules apply for operators. Shortcut evaluation is used for logical operators—the second argument is only evaluated if the value of the expression cannot be determined after evaluating the first argument. For example, in the expression a || b , b is only evaluated if a is not true. To compile an expression, use <xref:Lucene.Net.Expressions.Js.JavascriptCompiler>. Classes JavascriptCompiler An expression compiler for javascript expressions. ParseException"
},
"Lucene.Net.Expressions.JS.JavascriptCompiler.html": {
"href": "Lucene.Net.Expressions.JS.JavascriptCompiler.html",
"title": "Class JavascriptCompiler | Apache Lucene.NET 4.8.0-beta00010 Documentation",
"keywords": "Class JavascriptCompiler An expression compiler for javascript expressions. Inheritance System.Object JavascriptCompiler Inherited Members 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.JS Assembly : Lucene.Net.Expressions.dll Syntax public class JavascriptCompiler Remarks An expression compiler for javascript expressions. Example: Expression foo = JavascriptCompiler.Compile(\"((0.3*popularity)/10.0)+(0.7*score)\"); See the Lucene.Net.Expressions.JS for the supported syntax and default functions. You can compile with an alternate set of functions via Compile(String, IDictionary<String, MethodInfo>) . For example: IDictionary<string, MethodInfo> functions = new Dictionary<string, MethodInfo>(); // add all the default functions functions.PutAll(JavascriptCompiler.DEFAULT_FUNCTIONS); // add sqrt() functions.Put(\"sqrt\", (typeof(Math)).GetMethod(\"Sqrt\", new Type[] { typeof(double) })); // call compile with customized function map Expression foo = JavascriptCompiler.Compile(\"sqrt(score)+ln(popularity)\", functions); This is a Lucene.NET EXPERIMENTAL API, use at your own risk Fields | Improve this Doc View Source DEFAULT_FUNCTIONS The default set of functions available to expressions. Declaration public static readonly IDictionary<string, MethodInfo> DEFAULT_FUNCTIONS Field Value Type Description System.Collections.Generic.IDictionary < System.String , System.Reflection.MethodInfo > Remarks The default set of functions available to expressions. See the Lucene.Net.Expressions.JS for a list. Methods | Improve this Doc View Source Compile(String) Compiles the given expression. Declaration public static Expression Compile(string sourceText) Parameters Type Name Description System.String sourceText The expression to compile Returns Type Description Expression A new compiled expression Exceptions Type Condition ParseException on failure to compile | Improve this Doc View Source Compile(String, IDictionary<String, MethodInfo>) Compiles the given expression with the supplied custom functions. Declaration public static Expression Compile(string sourceText, IDictionary<string, MethodInfo> functions) Parameters Type Name Description System.String sourceText The expression to compile System.Collections.Generic.IDictionary < System.String , System.Reflection.MethodInfo > functions map of System.String names to functions Returns Type Description Expression A new compiled expression Remarks Compiles the given expression with the supplied custom functions. Functions must be public static , return System.Double and can take from zero to 256 System.Double parameters. Exceptions Type Condition ParseException on failure to compile"
},
"Lucene.Net.Expressions.JS.ParseException.html": {
"href": "Lucene.Net.Expressions.JS.ParseException.html",
"title": "Class ParseException | Apache Lucene.NET 4.8.0-beta00010 Documentation",
"keywords": "Class ParseException Inheritance System.Object System.Exception ParseException Implements System.Runtime.Serialization.ISerializable Inherited Members System.Exception.GetBaseException() System.Exception.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext) System.Exception.GetType() System.Exception.ToString() System.Exception.Data System.Exception.HelpLink System.Exception.HResult System.Exception.InnerException System.Exception.Message System.Exception.Source System.Exception.StackTrace System.Exception.TargetSite System.Exception.SerializeObjectState System.Object.Equals(System.Object) System.Object.Equals(System.Object, System.Object) System.Object.GetHashCode() System.Object.MemberwiseClone() System.Object.ReferenceEquals(System.Object, System.Object) Namespace : Lucene.Net.Expressions.JS Assembly : Lucene.Net.Expressions.dll Syntax public class ParseException : Exception, ISerializable Constructors | Improve this Doc View Source ParseException(String, Int32) Declaration public ParseException(string message, int charPositionInLine) Parameters Type Name Description System.String message System.Int32 charPositionInLine Implements System.Runtime.Serialization.ISerializable"
},
"Lucene.Net.Expressions.SimpleBindings.html": {
"href": "Lucene.Net.Expressions.SimpleBindings.html",
"title": "Class SimpleBindings | Apache Lucene.NET 4.8.0-beta00010 Documentation",
"keywords": "Class SimpleBindings Simple class that binds expression variable names to Lucene.Net.Search.SortField s or other Expression s. 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 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"
},
"overview.html": {
"href": "overview.html",
"title": "The Expressions Module for Apache Lucene | Apache Lucene.NET 4.8.0-beta00010 Documentation",
"keywords": "The Expressions Module for Apache Lucene <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> The expressions module is new to Lucene 4.6. It provides an API for dynamically computing per-document values based on string expressions. The module is organized in two sections: 1. The Expressions Module for Apache Lucene - The abstractions and simple utilities for common operations like sorting on an expression 2. <xref:Lucene.Net.Expressions.Js> - A compiler for a subset of JavaScript expressions For sample code showing how to use the API, see Expression ."
}
}