Pinned Query

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 request

  1. GET /_search
  2. {
  3. "query": {
  4. "pinned": {
  5. "ids": [ "1", "4", "100" ],
  6. "organic": {
  7. "match": {
  8. "description": "iphone"
  9. }
  10. }
  11. }
  12. }
  13. }

Top-level parameters for pinned

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.