Prefix query

Prefix query #

Returns documents that contain a specific prefix in a provided field.

Examples #

The following search returns documents where the org.id field contains a term that begins with inf.

GET /_search
{
  "query": {
    "prefix": {
      "org.id": {
        "value": "inf"
      }
    }
  }
}

Top-level parameters for prefix #

  • <field>
    (Required, object) Field you wish to search.

Parameters for <field> #

  • value
    (Required, string) Beginning characters of terms you wish to find in the provided <field>.
  • case_insensitive
    (Optional, Boolean) Allows ASCII case insensitive matching of the value with the indexed field values when set to true. Default is false.
Calendar February 24, 2024
Edit Edit this page