Skip to content
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 7 commits into from
May 23, 2024

Conversation

msfroh
Copy link
Contributor

@msfroh msfroh commented May 23, 2024

Description

Adds documentation for the constant_keyword field type added in opensearch-project/OpenSearch#12285.

Issues Resolved

Closes #7164

Checklist

  • By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and subject to the Developers Certificate of Origin.
    For more information on following Developer Certificate of Origin and signing off your commits, please check here.

---
layout: default
title: Constant Keyword
nav_order: 46
Copy link
Contributor Author

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 from keyword.md.

Copy link
Collaborator

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.

@kolchfa-aws kolchfa-aws self-assigned this May 23, 2024
Signed-off-by: Fanit Kolchina <[email protected]>
Copy link
Collaborator

@natebower natebower left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kolchfa-aws @msfroh Please see my comments and changes and let me know if you have any questions. Thanks!


# Constant keyword field type

A constant keyword field uses the same value for documents in the index.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"documents in the index" => "all documents in an index"?

_field-types/supported-field-types/constant-keyword.md Outdated Show resolved Hide resolved
_field-types/supported-field-types/constant-keyword.md Outdated Show resolved Hide resolved

Parameter | Description
:--- | :---
`value` | The string value for the field for all documents in the index.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"string value for the field" => "field string value"?

_field-types/supported-field-types/string.md Outdated Show resolved Hide resolved
Co-authored-by: Nathan Bower <[email protected]>
Signed-off-by: kolchfa-aws <[email protected]>
Copy link
Collaborator

@kolchfa-aws kolchfa-aws left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. @msfroh To what version(s) is this applicable?

@msfroh
Copy link
Contributor Author

msfroh commented May 23, 2024

LGTM. @msfroh To what version(s) is this applicable?

Versions >= 2.14

@kolchfa-aws kolchfa-aws added the backport 2.14 PR: Backport label for 2.14 label May 23, 2024
@kolchfa-aws kolchfa-aws merged commit 7f65cda into opensearch-project:main May 23, 2024
5 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request May 23, 2024
* Add documentation for `constant_keyword` field type

Signed-off-by: Michael Froh <[email protected]>

* Fix nav_order and bad copy/pasted table entry

Signed-off-by: Michael Froh <[email protected]>

* Doc review

Signed-off-by: Fanit Kolchina <[email protected]>

* Apply suggestions from code review

Co-authored-by: Nathan Bower <[email protected]>
Signed-off-by: kolchfa-aws <[email protected]>

* Update _field-types/supported-field-types/string.md

Signed-off-by: kolchfa-aws <[email protected]>

* Update _field-types/supported-field-types/constant-keyword.md

Signed-off-by: kolchfa-aws <[email protected]>

---------

Signed-off-by: Michael Froh <[email protected]>
Signed-off-by: Fanit Kolchina <[email protected]>
Signed-off-by: kolchfa-aws <[email protected]>
Co-authored-by: Fanit Kolchina <[email protected]>
Co-authored-by: kolchfa-aws <[email protected]>
Co-authored-by: Nathan Bower <[email protected]>
(cherry picked from commit 7f65cda)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Copy link

@mrpi mrpi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The provided example is being rejected by opensearch 2.14.0

"properties" : {
"genre" : {
"value" : "Romantic comedy"
}
Copy link

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" } ...

Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.14 PR: Backport label for 2.14 v2.14.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DOC] add constant keyword field
5 participants