Suffix query

Suffix query #

Returns documents that contain terms ending in the provided value. This is the mirror of the prefix query; like a leading wildcard, it is more expensive than a prefix match.

Inside a nested query: not supported yet — the clause is rejected with an HTTP 400 naming the offending clause.

Examples #

POST /my-collection/_search
{
  "query": {
    "suffix": {
      "field": "url.path",
      "value": ".jpg"
    }
  }
}

Parameters for suffix #

  • <field>
    (Required, string) Field you wish to search.
  • value
    (Required, string) The suffix terms must end with.
  • case_insensitive
    (Optional, boolean, default: false) ASCII case-insensitive matching of the value with the indexed field values.
  • boost
    (Optional, float, default: 1.0) Decrease or increase the relevance scores of the query.
  • rewrite
    (Optional, string) Method used to rewrite the query (constant_score, scoring_boolean, …).
Calendar September 27, 2026
Edit Edit this page