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?

Signed-off-by: gaobinlong <gbinlong@amazon.com>
@github-actions
Copy link
Contributor

github-actions bot commented Aug 6, 2025

✅ Gradle check result for 36687c8: SUCCESS

Signed-off-by: Bruce Hong <bruce.hong@glean.com>
@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.

Signed-off-by: Bruce Hong <bruce.hong@glean.com>
@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 <andrross@amazon.com>
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 <andrross@amazon.com>
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 <bruce.hong@glean.com>

* Rebase

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

* Fix rest-api-spec:spotlessApply

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

* Run :server:spotlessApply

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

* Improve test coverage

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

* Spotless apply

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

* DRY-er

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

* Spotless check

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

* Comments

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

* Comments

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

---------

Signed-off-by: Bruce Hong <bruce.hong@glean.com>
Signed-off-by: gaobinlong <gbinlong@amazon.com>
Co-authored-by: gaobinlong <gbinlong@amazon.com>
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 <andrross@amazon.com>
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 <bruce.hong@glean.com>

* Rebase

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

* Fix rest-api-spec:spotlessApply

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

* Run :server:spotlessApply

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

* Improve test coverage

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

* Spotless apply

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

* DRY-er

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

* Spotless check

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

* Comments

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

* Comments

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

---------

Signed-off-by: Bruce Hong <bruce.hong@glean.com>
Signed-off-by: gaobinlong <gbinlong@amazon.com>
Co-authored-by: gaobinlong <gbinlong@amazon.com>
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 <andrross@amazon.com>
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 <bruce.hong@glean.com>

* Rebase

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

* Fix rest-api-spec:spotlessApply

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

* Run :server:spotlessApply

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

* Improve test coverage

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

* Spotless apply

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

* DRY-er

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

* Spotless check

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

* Comments

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

* Comments

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

---------

Signed-off-by: Bruce Hong <bruce.hong@glean.com>
Signed-off-by: gaobinlong <gbinlong@amazon.com>
Co-authored-by: gaobinlong <gbinlong@amazon.com>
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 <andrross@amazon.com>
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 <bruce.hong@glean.com>

* Rebase

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

* Fix rest-api-spec:spotlessApply

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

* Run :server:spotlessApply

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

* Improve test coverage

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

* Spotless apply

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

* DRY-er

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

* Spotless check

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

* Comments

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

* Comments

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

---------

Signed-off-by: Bruce Hong <bruce.hong@glean.com>
Signed-off-by: gaobinlong <gbinlong@amazon.com>
Co-authored-by: gaobinlong <gbinlong@amazon.com>
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 <andrross@amazon.com>
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 <bruce.hong@glean.com>

* Rebase

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

* Fix rest-api-spec:spotlessApply

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

* Run :server:spotlessApply

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

* Improve test coverage

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

* Spotless apply

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

* DRY-er

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

* Spotless check

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

* Comments

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

* Comments

Signed-off-by: Bruce Hong <bruce.hong@glean.com>

---------

Signed-off-by: Bruce Hong <bruce.hong@glean.com>
Signed-off-by: gaobinlong <gbinlong@amazon.com>
Co-authored-by: gaobinlong <gbinlong@amazon.com>
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 <andrross@amazon.com>
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