Skip to content

Commit 6fbb435

Browse files
ioanatiaalbertzaharovits
authored andcommitted
Document how to query for a specific feature within rank_features (#110749)
1 parent a37f0d4 commit 6fbb435

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

docs/reference/mapping/types/rank-features.asciidoc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,23 @@ GET my-index-000001/_search
7070
}
7171
}
7272
}
73+
74+
GET my-index-000001/_search
75+
{
76+
"query": { <6>
77+
"term": {
78+
"topics": "economics"
79+
}
80+
}
81+
}
7382
--------------------------------------------------
7483

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

8191

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

0 commit comments

Comments
 (0)