Skip to content

Commit

Permalink
Document how to query for a specific feature within rank_features (el…
Browse files Browse the repository at this point in the history
  • Loading branch information
ioanatia authored Jul 11, 2024
1 parent a92baa9 commit f7c4045
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/reference/mapping/types/rank-features.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,23 @@ GET my-index-000001/_search
}
}
}
GET my-index-000001/_search
{
"query": { <6>
"term": {
"topics": "economics"
}
}
}
--------------------------------------------------

<1> Rank features fields must use the `rank_features` field type
<2> Rank features that correlate negatively with the score need to declare it
<3> Rank features fields must be a hash with string keys and strictly positive numeric values
<4> This query ranks documents by how much they are about the "politics" topic.
<5> This query ranks documents inversely to the number of "1star" reviews they received.
<6> This query returns documents that store the "economics" feature in the "topics" field.


NOTE: `rank_features` fields only support single-valued features and strictly
Expand Down

0 comments on commit f7c4045

Please sign in to comment.