Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 14 additions & 17 deletions en/reference/ranking/rank-features.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,20 @@
</p>
<ul>
<li>
Types: All rank feature values are floats. Integers are converted to exact whole value floats.
String values are converted to exact whole value floats using a hash function.
Types: All rank feature values are doubles or tensors. Integers are converted to exact whole value doubles.
String values are converted to exact whole value doubles using a hash function.
String literals in ranking expressions are converted using the same hash function,
to enable equality tests on string values.
</li><li>
</li>
<li>
Features which are <em>normalized</em> are between 0 and 1, where 0 is always the minimum and 1 the maximum.
Normalized features should normally be preferred because they are more easily combined by
<a href="ranking-expressions.html">ranking expressions</a> into a complete normalized score.
</li><li>
</li>
<li>
A query may override <em>any</em> rank feature value by submitting that value as a feature with the query.
</li><li>
</li>
<li>
Some features have parameters. It is always allowed to quote parameters with <em>"</em>.
Nested quotes are not allowed and must be escaped using <em>\</em>.
Parameters that can be parsed as feature names may be left unquoted.
Expand All @@ -42,11 +45,7 @@ <h2 id="feature-list">Feature list</h2>
<!--table-to-list-->
<table class="table" id="rank-feature-table">





<tr><td colspan="3"></td></tr>
<tr><td colspan="3"></td></tr>
<tr><td colspan="3"><h3 id="query-features">Query features</h3></td></tr>
<tr class="trx"><th class="thx">Feature name</th><th class="thx">Default</th><th class="thx">Description</th></tr>

Expand Down Expand Up @@ -381,7 +380,7 @@ <h2 id="feature-list">Feature list</h2>
<td>0</td>
<td><p id="fieldMatch(name).absoluteOccurrence">
Returns a normalized measure of the number of occurrence of the terms of the query:
</p><p class="equation-container" class="equation-container"><!-- depends on mathjax -->
</p><p class="equation-container"><!-- depends on mathjax -->
$$\frac{\sum_{\text{all query terms}}(min(\text{number of occurrences of the term},maxOccurrences))}{(\text{query term count} &times; 100)}$$
</p><p>
This is 1 if there are many occurrences of the query terms, and 0 if there are none.
Expand Down Expand Up @@ -838,10 +837,8 @@ <h3 id="attribute-match-features-normalized">Attribute match features - normaliz
<td>0</td>
<td><p id="closeness(dimension,name)">
Used with the <a href="../querying/yql.html#nearestneighbor">nearestNeighbor</a> query operator.
A number which is close to 1 when a point vector in the document is close
to a matching point vector in the query.
The document vectors and the query vector must be the same tensor
type, with one indexed dimension of size N, representing a point in an N-dimensional space.
A number which is close to 1 when a vector in the document tensor is close to the vector given in the query.
The indexed dimension representing a vector in document and query tensors must be identical.
</p>
<ul>
<li>
Expand Down Expand Up @@ -899,12 +896,12 @@ <h3 id="attribute-match-features-normalized">Attribute match features - normaliz
<td><p id="freshness(name).logscale">
A logarithmic-shaped freshness; also goes from 1 to 0, but looks like <a href="#freshness">freshness plot</a>.
The function is based on <code>-log(age(name) + scale)</code> and is calculated as:
</p><p class="equation-container" class="equation-container"><!-- depends on mathjax -->
</p><p class="equation-container"><!-- depends on mathjax -->
$$\frac{log(maxAge + scale) - log(age(name) + scale)}{log(maxAge + scale) - log(scale)}$$
</p><p>
where scale is defined using
<a href="rank-feature-configuration.html#freshness"> halfResponse and maxAge</a>:
</p><p class="equation-container" class="equation-container"><!-- depends on mathjax -->
</p><p class="equation-container"><!-- depends on mathjax -->
$$\frac{-halfResponse^2}{2 &times; halfResponse - maxAge}$$
</p><p>
When <code>age(name) == halfResponse</code> the function output is 0.5.</p>
Expand Down