原文地址: https://www.elastic.co/guide/en/elasticsearch/reference/7.7/query-dsl-pinned-query.html, 原文档版权归 www.elastic.co 所有
IMPORTANT: No additional bug fixes or documentation updates
will be released for this version. For the latest information, see the
current release documentation.
Pinned Queryedit
Promotes selected documents to rank higher than those matching a given query.
This feature is typically used to guide searchers to curated documents that are
promoted over and above any "organic" matches for a search.
The promoted or "pinned" documents are identified using the document IDs stored in
the _id
field.
Example requestedit
GET /_search { "query": { "pinned" : { "ids" : ["1", "4", "100"], "organic" : { "match":{ "description": "brown shoes" } } } } }
Top-level parameters for pinned
edit
-
ids
- An array of document IDs listed in the order they are to appear in results.
-
organic
- Any choice of query used to rank documents which will be ranked below the "pinned" document ids.