-
Notifications
You must be signed in to change notification settings - Fork 501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add documentation for constant_keyword
field type
#7235
Changes from 1 commit
606e0aa
c578319
62ab9f3
0fa1911
8a8c3df
85c7643
c3e667d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
layout: default | ||
title: Constant Keyword | ||
nav_order: 46 | ||
has_children: false | ||
parent: String field types | ||
grand_parent: Supported field types | ||
redirect_from: | ||
- /opensearch/supported-field-types/constant-keyword/ | ||
- /field-types/constant-keyword/ | ||
--- | ||
|
||
# Constant keyword field type | ||
|
||
A constant keyword field uses the same value for documents in the index. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "documents in the index" => "all documents in an index"?
kolchfa-aws marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
When a search request spans multiple indices, you can filter on a constant keyword field to match documents from indices with the given constant value, | ||
Check failure on line 17 in _field-types/supported-field-types/constant-keyword.md GitHub Actions / style-job
Check failure on line 17 in _field-types/supported-field-types/constant-keyword.md GitHub Actions / style-job
|
||
but not indices with a different value. | ||
Check failure on line 18 in _field-types/supported-field-types/constant-keyword.md GitHub Actions / style-job
|
||
|
||
## Example | ||
|
||
The following query creates a mapping with a constant keyword field. | ||
kolchfa-aws marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
```json | ||
PUT romcom_movies | ||
{ | ||
"mappings" : { | ||
"properties" : { | ||
"genre" : { | ||
"value" : "Romantic comedy" | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This example does not work. The "type" field is missing. It must look something like this:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
} | ||
} | ||
} | ||
``` | ||
{% include copy-curl.html %} | ||
|
||
## Parameters | ||
|
||
The following table lists the parameters accepted by constant keyword field types. All values are required. | ||
|
||
Parameter | Description | ||
:--- | :--- | ||
`value` | The string value for the field for all documents in the index. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "string value for the field" => "field string value"?
kolchfa-aws marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh -- I probably need to change the
nav_order
. This was copied fromkeyword.md
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@msfroh Thanks so much for providing this PR! Yes, nav_order is the order the page appears in the left navigation. And redirect_from is only needed when a page has moved from another location so not needed for new pages.