Skip to content

Conversation

@bruce-hong-glean
Copy link
Contributor

@bruce-hong-glean bruce-hong-glean commented Jul 23, 2025

Description

This PR adds the dynamic: false_allow_templates option to the schema. This creates mappings for any field that matches properties or dynamic_templates, and ignores any fields that do not (as opposed to rejecting altogether).

Example from linked issue, the usage is:

  1. Create the index:
{
    "properties": {
        "url": { "type": "keyword" },
    },
    "dynamic": "false_allow_templates",
    "dynamic_templates": [
        {
            "dates": {
                "match": "date_*",
                "mapping": {
                    "type": "date",
                },
            },
        }
    ]
}
  1. url matches an explicit property and the fields date_timestamp and date_timezone math the dynamic template:
POST index1/_doc/1
{
  "url": "www.example.com",
  "date_timestamp": "...",
  "date_timezone": "...",
  "misc_field": "..."
}
  1. Produces the mapping:
{
    "properties": {
        "url": { "type": "keyword" },
        "date_timestamp": { "type": "date" },
        "date_timezone": { "type": "date" }
    }
}

Related Issues

Resolves #18617

Check List

  • Functionality includes testing.
  • API changes companion pull request created
  • Public documentation issue/PR created

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

@github-actions github-actions bot added enhancement Enhancement or improvement to existing feature or request Indexing Indexing, Bulk Indexing and anything related to indexing labels Jul 23, 2025
@github-actions
Copy link
Contributor

❌ Gradle check result for 4f37b48: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@github-actions
Copy link
Contributor

❌ Gradle check result for 0a6476a: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@github-actions
Copy link
Contributor

github-actions bot commented Aug 6, 2025

✅ Gradle check result for 36687c8: SUCCESS

@github-actions
Copy link
Contributor

github-actions bot commented Aug 6, 2025

❕ Gradle check result for 0eebef1: UNSTABLE

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

@github-actions
Copy link
Contributor

❌ Gradle check result for a632fd3: TIMEOUT

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@github-actions
Copy link
Contributor

✅ Gradle check result for a632fd3: SUCCESS

@gaobinlong gaobinlong merged commit 9f28ef8 into opensearch-project:main Aug 13, 2025
32 of 34 checks passed
andrross added a commit to andrross/OpenSearch that referenced this pull request Aug 13, 2025
…arch-project#18825)"

This reverts commit 9f28ef8.

Lots of test failures blocking PRs for the newly added yaml test.

Signed-off-by: Andrew Ross <[email protected]>
andrross added a commit that referenced this pull request Aug 13, 2025
…" (#19061)

This reverts commit 9f28ef8.

Lots of test failures blocking PRs for the newly added yaml test.

Signed-off-by: Andrew Ross <[email protected]>
bruce-hong-glean added a commit to bruce-hong-glean/OpenSearch that referenced this pull request Aug 13, 2025
RajatGupta02 pushed a commit to RajatGupta02/OpenSearch that referenced this pull request Aug 18, 2025
…ject#18825)

* Starting work, untested

Update tests

Tests

Tests

Cleanup

Tested, cleanup

Cleanup

Signed-off-by: Bruce Hong <[email protected]>

* Rebase

Signed-off-by: Bruce Hong <[email protected]>

* Fix rest-api-spec:spotlessApply

Signed-off-by: Bruce Hong <[email protected]>

* Run :server:spotlessApply

Signed-off-by: Bruce Hong <[email protected]>

* Improve test coverage

Signed-off-by: Bruce Hong <[email protected]>

* Spotless apply

Signed-off-by: Bruce Hong <[email protected]>

* DRY-er

Signed-off-by: Bruce Hong <[email protected]>

* Spotless check

Signed-off-by: Bruce Hong <[email protected]>

* Comments

Signed-off-by: Bruce Hong <[email protected]>

* Comments

Signed-off-by: Bruce Hong <[email protected]>

---------

Signed-off-by: Bruce Hong <[email protected]>
Signed-off-by: gaobinlong <[email protected]>
Co-authored-by: gaobinlong <[email protected]>
RajatGupta02 pushed a commit to RajatGupta02/OpenSearch that referenced this pull request Aug 18, 2025
…arch-project#18825)" (opensearch-project#19061)

This reverts commit 9f28ef8.

Lots of test failures blocking PRs for the newly added yaml test.

Signed-off-by: Andrew Ross <[email protected]>
karenyrx pushed a commit to karenyrx/OpenSearch that referenced this pull request Aug 21, 2025
…ject#18825)

* Starting work, untested

Update tests

Tests

Tests

Cleanup

Tested, cleanup

Cleanup

Signed-off-by: Bruce Hong <[email protected]>

* Rebase

Signed-off-by: Bruce Hong <[email protected]>

* Fix rest-api-spec:spotlessApply

Signed-off-by: Bruce Hong <[email protected]>

* Run :server:spotlessApply

Signed-off-by: Bruce Hong <[email protected]>

* Improve test coverage

Signed-off-by: Bruce Hong <[email protected]>

* Spotless apply

Signed-off-by: Bruce Hong <[email protected]>

* DRY-er

Signed-off-by: Bruce Hong <[email protected]>

* Spotless check

Signed-off-by: Bruce Hong <[email protected]>

* Comments

Signed-off-by: Bruce Hong <[email protected]>

* Comments

Signed-off-by: Bruce Hong <[email protected]>

---------

Signed-off-by: Bruce Hong <[email protected]>
Signed-off-by: gaobinlong <[email protected]>
Co-authored-by: gaobinlong <[email protected]>
karenyrx pushed a commit to karenyrx/OpenSearch that referenced this pull request Aug 21, 2025
…arch-project#18825)" (opensearch-project#19061)

This reverts commit 9f28ef8.

Lots of test failures blocking PRs for the newly added yaml test.

Signed-off-by: Andrew Ross <[email protected]>
atris pushed a commit to atris/OpenSearch that referenced this pull request Aug 28, 2025
…ject#18825)

* Starting work, untested

Update tests

Tests

Tests

Cleanup

Tested, cleanup

Cleanup

Signed-off-by: Bruce Hong <[email protected]>

* Rebase

Signed-off-by: Bruce Hong <[email protected]>

* Fix rest-api-spec:spotlessApply

Signed-off-by: Bruce Hong <[email protected]>

* Run :server:spotlessApply

Signed-off-by: Bruce Hong <[email protected]>

* Improve test coverage

Signed-off-by: Bruce Hong <[email protected]>

* Spotless apply

Signed-off-by: Bruce Hong <[email protected]>

* DRY-er

Signed-off-by: Bruce Hong <[email protected]>

* Spotless check

Signed-off-by: Bruce Hong <[email protected]>

* Comments

Signed-off-by: Bruce Hong <[email protected]>

* Comments

Signed-off-by: Bruce Hong <[email protected]>

---------

Signed-off-by: Bruce Hong <[email protected]>
Signed-off-by: gaobinlong <[email protected]>
Co-authored-by: gaobinlong <[email protected]>
atris pushed a commit to atris/OpenSearch that referenced this pull request Aug 28, 2025
…arch-project#18825)" (opensearch-project#19061)

This reverts commit 9f28ef8.

Lots of test failures blocking PRs for the newly added yaml test.

Signed-off-by: Andrew Ross <[email protected]>
kh3ra pushed a commit to kh3ra/OpenSearch that referenced this pull request Sep 5, 2025
…ject#18825)

* Starting work, untested

Update tests

Tests

Tests

Cleanup

Tested, cleanup

Cleanup

Signed-off-by: Bruce Hong <[email protected]>

* Rebase

Signed-off-by: Bruce Hong <[email protected]>

* Fix rest-api-spec:spotlessApply

Signed-off-by: Bruce Hong <[email protected]>

* Run :server:spotlessApply

Signed-off-by: Bruce Hong <[email protected]>

* Improve test coverage

Signed-off-by: Bruce Hong <[email protected]>

* Spotless apply

Signed-off-by: Bruce Hong <[email protected]>

* DRY-er

Signed-off-by: Bruce Hong <[email protected]>

* Spotless check

Signed-off-by: Bruce Hong <[email protected]>

* Comments

Signed-off-by: Bruce Hong <[email protected]>

* Comments

Signed-off-by: Bruce Hong <[email protected]>

---------

Signed-off-by: Bruce Hong <[email protected]>
Signed-off-by: gaobinlong <[email protected]>
Co-authored-by: gaobinlong <[email protected]>
kh3ra pushed a commit to kh3ra/OpenSearch that referenced this pull request Sep 5, 2025
…arch-project#18825)" (opensearch-project#19061)

This reverts commit 9f28ef8.

Lots of test failures blocking PRs for the newly added yaml test.

Signed-off-by: Andrew Ross <[email protected]>
vinaykpud pushed a commit to vinaykpud/OpenSearch that referenced this pull request Sep 26, 2025
…ject#18825)

* Starting work, untested

Update tests

Tests

Tests

Cleanup

Tested, cleanup

Cleanup

Signed-off-by: Bruce Hong <[email protected]>

* Rebase

Signed-off-by: Bruce Hong <[email protected]>

* Fix rest-api-spec:spotlessApply

Signed-off-by: Bruce Hong <[email protected]>

* Run :server:spotlessApply

Signed-off-by: Bruce Hong <[email protected]>

* Improve test coverage

Signed-off-by: Bruce Hong <[email protected]>

* Spotless apply

Signed-off-by: Bruce Hong <[email protected]>

* DRY-er

Signed-off-by: Bruce Hong <[email protected]>

* Spotless check

Signed-off-by: Bruce Hong <[email protected]>

* Comments

Signed-off-by: Bruce Hong <[email protected]>

* Comments

Signed-off-by: Bruce Hong <[email protected]>

---------

Signed-off-by: Bruce Hong <[email protected]>
Signed-off-by: gaobinlong <[email protected]>
Co-authored-by: gaobinlong <[email protected]>
vinaykpud pushed a commit to vinaykpud/OpenSearch that referenced this pull request Sep 26, 2025
…arch-project#18825)" (opensearch-project#19061)

This reverts commit 9f28ef8.

Lots of test failures blocking PRs for the newly added yaml test.

Signed-off-by: Andrew Ross <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Enhancement or improvement to existing feature or request Indexing Indexing, Bulk Indexing and anything related to indexing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] dynamic mapping setting called "false_allow_templates"

3 participants