Skip to content

Commit

Permalink
Merge pull request #2892 from vespa-engine/bratseth/weighted-set
Browse files Browse the repository at this point in the history
Correct and improve weighted set documentation
  • Loading branch information
kkraune authored Sep 27, 2023
2 parents 26805c9 + efd988b commit 531c5e7
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions en/reference/schema-reference.html
Original file line number Diff line number Diff line change
Expand Up @@ -1058,30 +1058,29 @@ <h2 id="field">field</h2>
The element type can be any single value type. Prefer not to use floating point number types
like <em>float</em> or <em>double</em>.

The weights may be assigned any semantics by the application.
Two main use cases:
<ul>
<li>The weight symbolizes the number of occurrences</li>
<li>The weight specifies another value type, for instance the importance of the document</li>
</ul>

<p>
The weight of a matching value is by default used in <a href="../nativerank.html">nativeRank</a>
directly as the rank score of the field. For fine control of how weights are used in ranking when
To access a weighted set in ranking when
using <code>attribute</code>, see
<a href="rank-features.html#attribute-match-features-not-normalized">attribute the match features</a>,
or convert the weighted set to a tensor using the tensorFromWeightedSet(field, dimensionName) feature.
</p>
<p>
To access a weighted set in ranking when
using <code>index</code>, see
<a href="rank-features.html#features-for-indexed-multivalue-string-fields">ranking features
for indexed multi-valued fields</a>. When using <code>index</code> with weightedset, queries
for indexed multi-valued fields</a>. Note that when using <code>index</code> with weightedset, queries
are matching across elements in the set.
</p><p>
</p>
<p>
It is possible to specify that a new key should be created if it does not exist before the update,
and that it should be removed if the weight is set to zero -
see the <a href="#weightedset-properties">reference</a> for an example.
</p><p>

see the <a href="#weightedset-properties">reference</a>.
</p>
<p>
The weightedset field does not support filtering on weight.
Solve this using the <a href="#map">map</a> type and
If you need that use the <a href="#map">map</a> type and
<a href="query-language-reference.html#sameelement">sameElement</a> query operator -
see <a href="../query-language.html#map">example</a>.
see <a href="../query-language.html#map">this example</a>.
</p>
<table class="table">
<thead></thead><tbody>
Expand Down

0 comments on commit 531c5e7

Please sign in to comment.