blob: d4c2a8871d23ae2ae4066f4b51c6f7a031fc801e [file] [log] [blame]
<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Namespace Lucene.Net.Queries.Function.ValueSources
| Apache Lucene.NET 4.8.0-beta00013 Documentation </title>
<meta name="viewport" content="width=device-width">
<meta name="title" content="Namespace Lucene.Net.Queries.Function.ValueSources
| Apache Lucene.NET 4.8.0-beta00013 Documentation ">
<meta name="generator" content="docfx 2.56.2.0">
<link rel="shortcut icon" href="https://lucenenet.apache.org/docs/4.8.0-beta00009/logo/favicon.ico">
<link rel="stylesheet" href="https://lucenenet.apache.org/docs/4.8.0-beta00009/styles/docfx.vendor.css">
<link rel="stylesheet" href="https://lucenenet.apache.org/docs/4.8.0-beta00009/styles/docfx.css">
<link rel="stylesheet" href="https://lucenenet.apache.org/docs/4.8.0-beta00009/styles/main.css">
<meta property="docfx:navrel" content="toc.html">
<meta property="docfx:tocrel" content="queries/toc.html">
<meta property="docfx:rel" content="https://lucenenet.apache.org/docs/4.8.0-beta00009/">
</head>
<body data-spy="scroll" data-target="#affix" data-offset="120">
<span id="forkongithub"><a href="https://github.com/apache/lucenenet" target="_blank">Fork me on GitHub</a></span>
<div id="wrapper">
<header>
<nav id="autocollapse" class="navbar ng-scope" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">
<img id="logo" class="svg" src="https://lucenenet.apache.org/docs/4.8.0-beta00009/logo/lucene-net-color.png" alt="">
</a>
</div>
<div class="collapse navbar-collapse" id="navbar">
<form class="navbar-form navbar-right" role="search" id="search">
<div class="form-group">
<input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
</div>
</form>
</div>
</div>
</nav>
<div class="subnav navbar navbar-default">
<div class="container hide-when-search">
<ul class="level0 breadcrumb">
<li>
<a href="https://lucenenet.apache.org/docs/4.8.0-beta00009/">API</a>
<span id="breadcrumb">
<ul class="breadcrumb">
<li></li>
</ul>
</span>
</li>
</ul>
</div>
</div>
</header>
<div class="container body-content">
<div id="search-results">
<div class="search-list"></div>
<div class="sr-items">
<p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
</div>
<ul id="pagination"></ul>
</div>
</div>
<div role="main" class="container body-content hide-when-search">
<div class="sidenav hide-when-search">
<a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
<div class="sidetoggle collapse" id="sidetoggle">
<div id="sidetoc"></div>
</div>
</div>
<div class="article row grid-right">
<div class="col-md-10">
<article class="content wrap" id="_content" data-uid="Lucene.Net.Queries.Function.ValueSources">
<h1 id="Lucene_Net_Queries_Function_ValueSources" data-uid="Lucene.Net.Queries.Function.ValueSources" class="text-break">Namespace Lucene.Net.Queries.Function.ValueSources
</h1>
<div class="markdown level0 summary"><!--
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.
-->
<p>A variety of functions to use with FunctionQuery.</p>
</div>
<div class="markdown level0 conceptual"></div>
<div class="markdown level0 remarks"></div>
<h3 id="classes">Classes
</h3>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.BoolFunction.html">BoolFunction</a></h4>
<section><p>Abstract parent class for those <a class="xref" href="Lucene.Net.Queries.Function.ValueSource.html">ValueSource</a> implementations which
apply boolean logic to their values</p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.ByteFieldSource.html">ByteFieldSource</a></h4>
<section><p>Obtains <span class="xref">System.Int32</span> field values from the <a class="xref" href="https://lucenenet.apache.org/docs/4.8.0-beta00013/api/core/Lucene.Net.Search.FieldCache.html">FieldCache</a>
using <a class="xref" href="https://lucenenet.apache.org/docs/4.8.0-beta00013/api/core/Lucene.Net.Search.IFieldCache.html#Lucene_Net_Search_IFieldCache_GetInt32s_Lucene_Net_Index_AtomicReader_System_String_Lucene_Net_Search_FieldCache_IInt32Parser_System_Boolean_">GetInt32s(AtomicReader, String, FieldCache.IInt32Parser, Boolean)</a>
and makes those values available as other numeric types, casting as needed. *</p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.BytesRefFieldSource.html">BytesRefFieldSource</a></h4>
<section><p>An implementation for retrieving <a class="xref" href="Lucene.Net.Queries.Function.FunctionValues.html">FunctionValues</a> instances for <span class="xref">System.String</span> based fields.</p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.ConstNumberSource.html">ConstNumberSource</a></h4>
<section><p><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.ConstNumberSource.html">ConstNumberSource</a> is the base class for all constant numbers</p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.ConstValueSource.html">ConstValueSource</a></h4>
<section><p><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.ConstValueSource.html">ConstValueSource</a> returns a constant for all documents</p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.DefFunction.html">DefFunction</a></h4>
<section><p><a class="xref" href="Lucene.Net.Queries.Function.ValueSource.html">ValueSource</a> implementation which only returns the values from the provided
<a class="xref" href="Lucene.Net.Queries.Function.ValueSource.html">ValueSource</a>s which are available for a particular docId. Consequently, when combined
with a <a class="xref" href="Lucene.Net.Queries.Function.ValueSources.ConstValueSource.html">ConstValueSource</a>, this function serves as a way to return a default
value when the values for a field are unavailable.</p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.DivSingleFunction.html">DivSingleFunction</a></h4>
<section><p>Function to divide &quot;a&quot; by &quot;b&quot;
<p>
NOTE: This was DivFloatFunction in Lucene</p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.DocFreqValueSource.html">DocFreqValueSource</a></h4>
<section><p><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.DocFreqValueSource.html">DocFreqValueSource</a> returns the number of documents containing the term.</p>
<div class="lucene-block lucene-internal">This is a Lucene.NET INTERNAL API, use at your own risk</div></section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.DoubleConstValueSource.html">DoubleConstValueSource</a></h4>
<section><p>Function that returns a constant double value for every document.</p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.DoubleFieldSource.html">DoubleFieldSource</a></h4>
<section><p>Obtains <span class="xref">System.Double</span> field values from <a class="xref" href="https://lucenenet.apache.org/docs/4.8.0-beta00013/api/core/Lucene.Net.Search.IFieldCache.html#Lucene_Net_Search_IFieldCache_GetDoubles_Lucene_Net_Index_AtomicReader_System_String_Lucene_Net_Search_FieldCache_IDoubleParser_System_Boolean_">GetDoubles(AtomicReader, String, FieldCache.IDoubleParser, Boolean)</a> and makes
those values available as other numeric types, casting as needed.</p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.DualSingleFunction.html">DualSingleFunction</a></h4>
<section><p>Abstract <a class="xref" href="Lucene.Net.Queries.Function.ValueSource.html">ValueSource</a> implementation which wraps two <a class="xref" href="Lucene.Net.Queries.Function.ValueSource.html">ValueSource</a>s
and applies an extendible <span class="xref">System.Single</span> function to their values.
<p>
NOTE: This was DualFloatFunction in Lucene</p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.EnumFieldSource.html">EnumFieldSource</a></h4>
<section><p>Obtains <span class="xref">System.Int32</span> field values from <a class="xref" href="https://lucenenet.apache.org/docs/4.8.0-beta00013/api/core/Lucene.Net.Search.IFieldCache.html#Lucene_Net_Search_IFieldCache_GetInt32s_Lucene_Net_Index_AtomicReader_System_String_Lucene_Net_Search_FieldCache_IInt32Parser_System_Boolean_">GetInt32s(AtomicReader, String, FieldCache.IInt32Parser, Boolean)</a> and makes
those values available as other numeric types, casting as needed.
StrVal of the value is not the <span class="xref">System.Int32</span> value, but its <span class="xref">System.String</span> (displayed) value</p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.FieldCacheSource.html">FieldCacheSource</a></h4>
<section><p>A base class for <a class="xref" href="Lucene.Net.Queries.Function.ValueSource.html">ValueSource</a> implementations that retrieve values for
a single field from the <a class="xref" href="https://lucenenet.apache.org/docs/4.8.0-beta00013/api/core/Lucene.Net.Search.FieldCache.html">FieldCache</a>.</p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.IDFValueSource.html">IDFValueSource</a></h4>
<section><p>Function that returns <a class="xref" href="https://lucenenet.apache.org/docs/4.8.0-beta00013/api/core/Lucene.Net.Search.Similarities.TFIDFSimilarity.html#Lucene_Net_Search_Similarities_TFIDFSimilarity_Idf_System_Int64_System_Int64_">Idf(Int64, Int64)</a>
for every document.
<p>
Note that the configured Similarity for the field must be
a subclass of <span class="xref">Lucene.Net.Search.Similarities.TFIDFSimilarity</span></p>
<div class="lucene-block lucene-internal">This is a Lucene.NET INTERNAL API, use at your own risk</div><p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.IfFunction.html">IfFunction</a></h4>
<section><p>Depending on the <span class="xref">System.Boolean</span> value of the <span class="xref">Lucene.Net.Queries.Function.ValueSources.IfFunction.ifSource</span> function,
returns the value of the <span class="xref">Lucene.Net.Queries.Function.ValueSources.IfFunction.trueSource</span> or <span class="xref">Lucene.Net.Queries.Function.ValueSources.IfFunction.falseSource</span> function.</p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.Int16FieldSource.html">Int16FieldSource</a></h4>
<section><p>Obtains <span class="xref">System.Int16</span> field values from the <a class="xref" href="https://lucenenet.apache.org/docs/4.8.0-beta00013/api/core/Lucene.Net.Search.FieldCache.html">FieldCache</a>
using <a class="xref" href="https://lucenenet.apache.org/docs/4.8.0-beta00013/api/core/Lucene.Net.Search.IFieldCache.html#Lucene_Net_Search_IFieldCache_GetInt16s_Lucene_Net_Index_AtomicReader_System_String_Lucene_Net_Search_FieldCache_IInt16Parser_System_Boolean_">GetInt16s(AtomicReader, String, FieldCache.IInt16Parser, Boolean)</a>
and makes those values available as other numeric types, casting as needed.
<p>
NOTE: This was ShortFieldSource in Lucene</p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.Int32FieldSource.html">Int32FieldSource</a></h4>
<section><p>Obtains <span class="xref">System.Int32</span> field values from <a class="xref" href="https://lucenenet.apache.org/docs/4.8.0-beta00013/api/core/Lucene.Net.Search.IFieldCache.html#Lucene_Net_Search_IFieldCache_GetInt32s_Lucene_Net_Index_AtomicReader_System_String_Lucene_Net_Search_FieldCache_IInt32Parser_System_Boolean_">GetInt32s(AtomicReader, String, FieldCache.IInt32Parser, Boolean)</a> and makes those
values available as other numeric types, casting as needed.
<p>
NOTE: This was IntFieldSource in Lucene</p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.Int64FieldSource.html">Int64FieldSource</a></h4>
<section><p>Obtains <span class="xref">System.Int64</span> field values from <a class="xref" href="https://lucenenet.apache.org/docs/4.8.0-beta00013/api/core/Lucene.Net.Search.IFieldCache.html#Lucene_Net_Search_IFieldCache_GetInt64s_Lucene_Net_Index_AtomicReader_System_String_Lucene_Net_Search_FieldCache_IInt64Parser_System_Boolean_">GetInt64s(AtomicReader, String, FieldCache.IInt64Parser, Boolean)</a> and makes those
values available as other numeric types, casting as needed.
<p>
NOTE: This was LongFieldSource in Lucene</p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.JoinDocFreqValueSource.html">JoinDocFreqValueSource</a></h4>
<section><p>Use a field value and find the Document Frequency within another field.</p>
<p>@since solr 4.0</p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.LinearSingleFunction.html">LinearSingleFunction</a></h4>
<section><p><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.LinearSingleFunction.html">LinearSingleFunction</a> implements a linear function over
another <a class="xref" href="Lucene.Net.Queries.Function.ValueSource.html">ValueSource</a>.
<p>
Normally Used as an argument to a <a class="xref" href="Lucene.Net.Queries.Function.FunctionQuery.html">FunctionQuery</a>
<p>
NOTE: This was LinearFloatFunction in Lucene</p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.LiteralValueSource.html">LiteralValueSource</a></h4>
<section><p>Pass a the field value through as a <span class="xref">System.String</span>, no matter the type // Q: doesn&apos;t this mean it&apos;s a &quot;str&quot;?</p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.MaxDocValueSource.html">MaxDocValueSource</a></h4>
<section><p>Returns the value of <a class="xref" href="https://lucenenet.apache.org/docs/4.8.0-beta00013/api/core/Lucene.Net.Index.IndexReader.html#Lucene_Net_Index_IndexReader_MaxDoc">MaxDoc</a>
for every document. This is the number of documents
including deletions.</p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.MaxSingleFunction.html">MaxSingleFunction</a></h4>
<section><p><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.MaxSingleFunction.html">MaxSingleFunction</a> returns the max of it&apos;s components.
<p>
NOTE: This was MaxFloatFunction in Lucene</p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.MinSingleFunction.html">MinSingleFunction</a></h4>
<section><p><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.MinSingleFunction.html">MinSingleFunction</a> returns the min of it&apos;s components.
<p>
NOTE: This was MinFloatFunction in Lucene</p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.MultiBoolFunction.html">MultiBoolFunction</a></h4>
<section><p>Abstract <a class="xref" href="Lucene.Net.Queries.Function.ValueSource.html">ValueSource</a> implementation which wraps multiple <a class="xref" href="Lucene.Net.Queries.Function.ValueSource.html">ValueSource</a>s
and applies an extendible <span class="xref">System.Boolean</span> function to their values.</p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.MultiFunction.html">MultiFunction</a></h4>
<section><p>Abstract parent class for <a class="xref" href="Lucene.Net.Queries.Function.ValueSource.html">ValueSource</a> implementations that wrap multiple
<a class="xref" href="Lucene.Net.Queries.Function.ValueSource.html">ValueSource</a>s and apply their own logic.</p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.MultiFunction.Values.html">MultiFunction.Values</a></h4>
<section></section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.MultiSingleFunction.html">MultiSingleFunction</a></h4>
<section><p>Abstract <a class="xref" href="Lucene.Net.Queries.Function.ValueSource.html">ValueSource</a> implementation which wraps multiple <a class="xref" href="Lucene.Net.Queries.Function.ValueSource.html">ValueSource</a>s
and applies an extendible <span class="xref">System.Single</span> function to their values.
<p>
NOTE: This was MultiFloatFunction in Lucene</p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.MultiValueSource.html">MultiValueSource</a></h4>
<section><p>A <a class="xref" href="Lucene.Net.Queries.Function.ValueSource.html">ValueSource</a> that abstractly represents <a class="xref" href="Lucene.Net.Queries.Function.ValueSource.html">ValueSource</a>s for
poly fields, and other things.</p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.NormValueSource.html">NormValueSource</a></h4>
<section><p>Function that returns <a class="xref" href="https://lucenenet.apache.org/docs/4.8.0-beta00013/api/core/Lucene.Net.Search.Similarities.TFIDFSimilarity.html#Lucene_Net_Search_Similarities_TFIDFSimilarity_DecodeNormValue_System_Int64_">DecodeNormValue(Int64)</a>
for every document.
<p>
Note that the configured Similarity for the field must be
a subclass of <span class="xref">Lucene.Net.Search.Similarities.TFIDFSimilarity</span></p>
<div class="lucene-block lucene-internal">This is a Lucene.NET INTERNAL API, use at your own risk</div><p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.NumDocsValueSource.html">NumDocsValueSource</a></h4>
<section><p>Returns the value of <a class="xref" href="https://lucenenet.apache.org/docs/4.8.0-beta00013/api/core/Lucene.Net.Index.IndexReader.html#Lucene_Net_Index_IndexReader_NumDocs">NumDocs</a>
for every document. This is the number of documents
excluding deletions.</p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.OrdFieldSource.html">OrdFieldSource</a></h4>
<section><p>Obtains the ordinal of the field value from the default Lucene <a class="xref" href="https://lucenenet.apache.org/docs/4.8.0-beta00013/api/core/Lucene.Net.Search.FieldCache.html">FieldCache</a> using StringIndex.
<p>
The native lucene index order is used to assign an ordinal value for each field value.
<p>
Field values (terms) are lexicographically ordered by unicode value, and numbered starting at 1.
<p>
Example:</p>
<pre><code> If there were only three field values: &quot;apple&quot;,&quot;banana&quot;,&quot;pear&quot;
then ord(&quot;apple&quot;)=1, ord(&quot;banana&quot;)=2, ord(&quot;pear&quot;)=3</code></pre>
<p><p>
WARNING: Ord depends on the position in an index and can thus change when other documents are inserted or deleted,
or if a MultiSearcher is used.
<p>
WARNING: as of Solr 1.4, ord() and rord() can cause excess memory use since they must use a FieldCache entry
at the top level reader, while sorting and function queries now use entries at the segment level. Hence sorting
or using a different function query, in addition to ord()/rord() will double memory use.</p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.PowSingleFunction.html">PowSingleFunction</a></h4>
<section><p>Function to raise the base &quot;a&quot; to the power &quot;b&quot;
<p>
NOTE: This was PowFloatFunction in Lucene</p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.ProductSingleFunction.html">ProductSingleFunction</a></h4>
<section><p><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.ProductSingleFunction.html">ProductSingleFunction</a> returns the product of it&apos;s components.
<p>
NOTE: This was ProductFloatFunction in Lucene</p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.QueryValueSource.html">QueryValueSource</a></h4>
<section><p><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.QueryValueSource.html">QueryValueSource</a> returns the relevance score of the query</p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.RangeMapSingleFunction.html">RangeMapSingleFunction</a></h4>
<section><p><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.RangeMapSingleFunction.html">RangeMapSingleFunction</a> implements a map function over
another <a class="xref" href="Lucene.Net.Queries.Function.ValueSource.html">ValueSource</a> whose values fall within <code>min</code> and <code>max</code> inclusive to <code>target</code>.
<p>
Normally used as an argument to a <a class="xref" href="Lucene.Net.Queries.Function.FunctionQuery.html">FunctionQuery</a>
<p>
NOTE: This was RangeMapFloatFunction in Lucene</p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.ReciprocalSingleFunction.html">ReciprocalSingleFunction</a></h4>
<section><p><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.ReciprocalSingleFunction.html">ReciprocalSingleFunction</a> implements a reciprocal function <code>f(x) = a/(mx+b)</code>, based on
the <span class="xref">System.Single</span> value of a field or function as exported by <a class="xref" href="Lucene.Net.Queries.Function.ValueSource.html">ValueSource</a>.
<p>
When a and b are equal, and <code>x&gt;=0</code>, this function has a maximum value of 1 that drops as x increases.
Increasing the value of a and b together results in a movement of the entire function to a flatter part of the curve.
<p>These properties make this an idea function for boosting more recent documents.
<p>Example:<code> recip(ms(NOW,mydatefield),3.16e-11,1,1)</code>
<p>A multiplier of 3.16e-11 changes the units from milliseconds to years (since there are about 3.16e10 milliseconds
per year). Thus, a very recent date will yield a value close to 1/(0+1) or 1,
a date a year in the past will get a multiplier of about 1/(1+1) or 1/2,
and date two years old will yield 1/(2+1) or 1/3.
<p>
NOTE: This was ReciprocalFloatFunction in Lucene</p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.ReverseOrdFieldSource.html">ReverseOrdFieldSource</a></h4>
<section><p>Obtains the ordinal of the field value from the default Lucene <a class="xref" href="https://lucenenet.apache.org/docs/4.8.0-beta00013/api/core/Lucene.Net.Search.FieldCache.html">FieldCache</a> using <a class="xref" href="https://lucenenet.apache.org/docs/4.8.0-beta00013/api/core/Lucene.Net.Search.IFieldCache.html#Lucene_Net_Search_IFieldCache_GetTermsIndex_Lucene_Net_Index_AtomicReader_System_String_System_Single_">GetTermsIndex(AtomicReader, String, Single)</a>
and reverses the order.
<p>
The native lucene index order is used to assign an ordinal value for each field value.
<p>Field values (terms) are lexicographically ordered by unicode value, and numbered starting at 1.
<p>
Example of reverse ordinal (rord):</p>
<pre><code> If there were only three field values: &quot;apple&quot;,&quot;banana&quot;,&quot;pear&quot;
then rord(&quot;apple&quot;)=3, rord(&quot;banana&quot;)=2, ord(&quot;pear&quot;)=1</code></pre>
<p><p>
WARNING: Ord depends on the position in an index and can thus change when other documents are inserted or deleted,
or if a MultiSearcher is used.
<p>
WARNING: as of Solr 1.4, ord() and rord() can cause excess memory use since they must use a FieldCache entry
at the top level reader, while sorting and function queries now use entries at the segment level. Hence sorting
or using a different function query, in addition to ord()/rord() will double memory use.</p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.ScaleSingleFunction.html">ScaleSingleFunction</a></h4>
<section><p>Scales values to be between <code>min</code> and <code>max</code>.
<p>This implementation currently traverses all of the source values to obtain
their min and max.
<p>This implementation currently cannot distinguish when documents have been
deleted or documents that have no value, and 0.0 values will be used for
these cases. This means that if values are normally all greater than 0.0, one can
still end up with 0.0 as the min value to map from. In these cases, an
appropriate map() function could be used as a workaround to change 0.0
to a value in the real range.
<p>
NOTE: This was ScaleFloatFunction in Lucene</p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.SimpleBoolFunction.html">SimpleBoolFunction</a></h4>
<section><p><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.BoolFunction.html">BoolFunction</a> implementation which applies an extendible <span class="xref">System.Boolean</span>
function to the values of a single wrapped <a class="xref" href="Lucene.Net.Queries.Function.ValueSource.html">ValueSource</a>.</p>
<p>Functions this can be used for include whether a field has a value or not,
or inverting the <span class="xref">System.Boolean</span> value of the wrapped <a class="xref" href="Lucene.Net.Queries.Function.ValueSource.html">ValueSource</a>.</p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.SimpleSingleFunction.html">SimpleSingleFunction</a></h4>
<section><p>A simple <span class="xref">System.Single</span> function with a single argument
<p>
NOTE: This was SimpleFloatFunction in Lucene</p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.SingleFieldSource.html">SingleFieldSource</a></h4>
<section><p>Obtains <span class="xref">System.Single</span> field values from <a class="xref" href="https://lucenenet.apache.org/docs/4.8.0-beta00013/api/core/Lucene.Net.Search.IFieldCache.html#Lucene_Net_Search_IFieldCache_GetSingles_Lucene_Net_Index_AtomicReader_System_String_Lucene_Net_Search_FieldCache_ISingleParser_System_Boolean_">GetSingles(AtomicReader, String, FieldCache.ISingleParser, Boolean)</a> and makes those
values available as other numeric types, casting as needed.
<p>
NOTE: This was FloatFieldSource in Lucene</p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.SingularFunction.html">SingularFunction</a></h4>
<section><p>A function with a single (one) argument.
<p>
NOTE: This was SingleFunction in Lucene, changed to avoid conusion with operations on the datatype <span class="xref">System.Single</span>.</p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.SumSingleFunction.html">SumSingleFunction</a></h4>
<section><p><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.SumSingleFunction.html">SumSingleFunction</a> returns the sum of its components.
<p>
NOTE: This was SumFloatFunction in Lucene</p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.SumTotalTermFreqValueSource.html">SumTotalTermFreqValueSource</a></h4>
<section><p><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.SumTotalTermFreqValueSource.html">SumTotalTermFreqValueSource</a> returns the number of tokens.
(sum of term freqs across all documents, across all terms).
Returns -1 if frequencies were omitted for the field, or if
the codec doesn&apos;t support this statistic.</p>
<div class="lucene-block lucene-internal">This is a Lucene.NET INTERNAL API, use at your own risk</div></section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.TermFreqValueSource.html">TermFreqValueSource</a></h4>
<section><p>Function that returns <span class="xref">Lucene.Net.Index.DocsEnum.Freq</span> for the
supplied term in every document.
<p>
If the term does not exist in the document, returns 0.
If frequencies are omitted, returns 1.</p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.TFValueSource.html">TFValueSource</a></h4>
<section><p>Function that returns <a class="xref" href="https://lucenenet.apache.org/docs/4.8.0-beta00013/api/core/Lucene.Net.Search.Similarities.TFIDFSimilarity.html#Lucene_Net_Search_Similarities_TFIDFSimilarity_Tf_System_Single_">Tf(Single)</a>
for every document.
<p>
Note that the configured Similarity for the field must be
a subclass of <span class="xref">Lucene.Net.Search.Similarities.TFIDFSimilarity</span></p>
<div class="lucene-block lucene-internal">This is a Lucene.NET INTERNAL API, use at your own risk</div><p>
</section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.TotalTermFreqValueSource.html">TotalTermFreqValueSource</a></h4>
<section><p><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.TotalTermFreqValueSource.html">TotalTermFreqValueSource</a> returns the total term freq
(sum of term freqs across all documents).
Returns -1 if frequencies were omitted for the field, or if
the codec doesn&apos;t support this statistic.</p>
<div class="lucene-block lucene-internal">This is a Lucene.NET INTERNAL API, use at your own risk</div></section>
<h4><a class="xref" href="Lucene.Net.Queries.Function.ValueSources.VectorValueSource.html">VectorValueSource</a></h4>
<section><p>Converts individual <a class="xref" href="Lucene.Net.Queries.Function.ValueSource.html">ValueSource</a> instances to leverage the FunctionValues *Val functions that work with multiple values,
i.e. <a class="xref" href="Lucene.Net.Queries.Function.FunctionValues.html#Lucene_Net_Queries_Function_FunctionValues_DoubleVal_System_Int32_System_Double___">DoubleVal(Int32, Double[])</a></p>
</section>
</article>
</div>
<div class="hidden-sm col-md-2" role="complementary">
<div class="sideaffix">
<div class="contribution">
<ul class="nav">
<li>
<a href="https://github.com/apache/lucenenet/blob/docs/4.8.0-beta00013/src/Lucene.Net.Queries/Function/ValueSources/package.md/#L2" class="contribution-link">Improve this Doc</a>
</li>
</ul>
</div>
<nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
<!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
</nav>
</div>
</div>
</div>
</div>
<footer>
<div class="grad-bottom"></div>
<div class="footer">
<div class="container">
<span class="pull-right">
<a href="#top">Back to top</a>
</span>
Copyright © 2020 The Apache Software Foundation, Licensed under the <a href='http://www.apache.org/licenses/LICENSE-2.0' target='_blank'>Apache License, Version 2.0</a><br> <small>Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation. <br>All other marks mentioned may be trademarks or registered trademarks of their respective owners.</small>
</div>
</div>
</footer>
</div>
<script type="text/javascript" src="https://lucenenet.apache.org/docs/4.8.0-beta00009/styles/docfx.vendor.js"></script>
<script type="text/javascript" src="https://lucenenet.apache.org/docs/4.8.0-beta00009/styles/docfx.js"></script>
<script type="text/javascript" src="https://lucenenet.apache.org/docs/4.8.0-beta00009/styles/main.js"></script>
</body>
</html>