-
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
606e0aa
Add documentation for `constant_keyword` field type
msfroh c578319
Fix nav_order and bad copy/pasted table entry
msfroh 62ab9f3
Doc review
kolchfa-aws 0fa1911
Apply suggestions from code review
kolchfa-aws 8a8c3df
Update _field-types/supported-field-types/string.md
kolchfa-aws 85c7643
Update _field-types/supported-field-types/constant-keyword.md
kolchfa-aws c3e667d
Merge branch 'main' into constant_keyword
kolchfa-aws File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
layout: default | ||
title: Constant keyword | ||
nav_order: 71 | ||
has_children: false | ||
parent: String field types | ||
grand_parent: Supported field types | ||
--- | ||
|
||
# Constant keyword field type | ||
|
||
A constant keyword field uses the same value for all documents in the index. | ||
|
||
When a search request spans multiple indexes, you can filter on a constant keyword field to match documents from indexes with the given constant value but not from indexes with a different value. | ||
|
||
## Example | ||
|
||
The following query creates a mapping with a constant keyword field: | ||
|
||
```json | ||
PUT romcom_movies | ||
{ | ||
"mappings" : { | ||
"properties" : { | ||
"genre" : { | ||
"value" : "Romantic comedy" | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
{% 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
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This example does not work. The "type" field is missing. It must look something like this:
... "genre" : { "type": "constant_keyword", "value" : "Romantic comedy" } ...
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.
Thank you, @mrpi! Corrected the example in #7256