Skip to content

Commit

Permalink
Updated LuceneDocument to take advantage of looking up feature values…
Browse files Browse the repository at this point in the history
… on existing features and selecting the max when parsing multi-value sparse vectors
  • Loading branch information
john-wagster committed Jun 3, 2024
1 parent bf99660 commit 999bdd1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/reference/mapping/types/sparse-vector.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Below is an example of passing in a document with overlapping feature names.
Consider that in this example two categories exist for positive sentiment and negative sentiment.
However, for the purposes of retrieval we also want the overall impact rather than specific sentiment.
In the example `impact` is stored as a multi-value sparse vector and only the max values of overlapping names are stored.
More specifically the final `GET` query here returns a `_score` of ~1.2.
More specifically the final `GET` query here returns a `_score` of ~1.2 (which is the `max(impact.delicious[0], impact.delicious[1]` and is approximate because we have a relative error of 0.4% as explained below)

[source,console]
--------------------------------
Expand Down Expand Up @@ -89,7 +89,7 @@ GET my-index-000001/_search
NOTE: `sparse_vector` fields can not be included in indices that were *created* on {es} versions between 8.0 and 8.10

NOTE: `sparse_vector` fields only support strictly positive values.
negative values will be rejected.
Negative values will be rejected.

NOTE: `sparse_vector` fields do not support querying, sorting or aggregating.
They may only be used within specialized queries.
Expand Down

0 comments on commit 999bdd1

Please sign in to comment.