Skip to content

Commit

Permalink
Updating documentation around keyword fields
Browse files Browse the repository at this point in the history
  • Loading branch information
harshavamsi committed Oct 31, 2023
1 parent 2812031 commit da6626f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions _field-types/supported-field-types/keyword.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ redirect_from:

A keyword field type contains a string that is not analyzed. It allows only exact, case-sensitive matches.

Keyword fields are both indexed and have doc_values enabled by default.

If you need to use a field for full-text search, map it as [`text`]({{site.url}}{{site.baseurl}}/opensearch/supported-field-types/text/) instead.
{: .note }

Expand All @@ -27,7 +29,8 @@ PUT movies
"mappings" : {
"properties" : {
"genre" : {
"type" : "keyword"
"type" : "keyword",
"index" : false // use doc_values instead
}
}
}
Expand All @@ -42,7 +45,7 @@ The following table lists the parameters accepted by keyword field types. All pa
Parameter | Description
:--- | :---
`boost` | A floating-point value that specifies the weight of this field toward the relevance score. Values above 1.0 increase the field's relevance. Values between 0.0 and 1.0 decrease the field's relevance. Default is 1.0.
`doc_values` | A Boolean value that specifies whether the field should be stored on disk so that it can be used for aggregations, sorting, or scripting. Default is `false`.
`doc_values` | A Boolean value that specifies whether the field should be stored on disk so that it can be used for aggregations, sorting, or scripting. Default is `true`.
`eager_global_ordinals` | Specifies whether global ordinals should be loaded eagerly on refresh. If the field is often used for aggregations, this parameter should be set to `true`. Default is `false`.
`fields` | To index the same string in several ways (for example, as a keyword and text), provide the fields parameter. You can specify one version of the field to be used for search and another to be used for sorting and aggregations.
`ignore_above` | Any string longer than this integer value should not be indexed. Default is 2147483647. Default dynamic mapping creates a keyword subfield for which `ignore_above` is set to 256.
Expand Down

0 comments on commit da6626f

Please sign in to comment.