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

[BUG] Field-level ignore_malformed should override index-level setting #16599

Open
andrross opened this issue Nov 8, 2024 · 2 comments
Open
Labels
bug Something isn't working good first issue Good for newcomers Indexing Indexing, Bulk Indexing and anything related to indexing

Comments

@andrross
Copy link
Member

andrross commented Nov 8, 2024

Describe the bug

The ignore_malformed property can be set at the index level and at the individual field level. I believe the field-level setting should override the index-level setting if both are present, but that is not the observed behavior for OpenSearch 2.4 and later.

Related component

Indexing

To Reproduce

Create an index like the following:

curl -X PUT -u admin:$PWD --insecure "https://localhost:9200/my-index-000001?pretty" -H 'Content-Type: application/json' -d'
{
  "settings": {
    "index.mapping.ignore_malformed": true
  },
  "mappings": {
    "properties": {
      "number_one": {
        "type": "byte"
      },
      "number_two": {
        "type": "integer",
        "ignore_malformed": false
      }
    }
  }
}
'

Index a document with a malformed value for the number_two field:

curl -X PUT -u admin:$PWD --insecure "https://localhost:9200/my-index-000001/_doc/2?pretty" -H 'Content-Type: application/json' -d'
{
  "text":       "Some text value",
  "number_two": "foo"
}
'

This succeeds, but it should fail because the ignore_malformed value has been set to false for that field.

Expected behavior

Field-level setting should override index-level setting.

Additional Details

This behaved as expected for versions of OpenSearch prior to 2.4.

Slack thread where originally reported: https://opensearch.slack.com/archives/C0539F41Z5X/p1730959987164549

@andrross andrross added bug Something isn't working untriaged labels Nov 8, 2024
@github-actions github-actions bot added the Indexing Indexing, Bulk Indexing and anything related to indexing label Nov 8, 2024
@RS146BIJAY RS146BIJAY added good first issue Good for newcomers and removed untriaged labels Nov 11, 2024
@RS146BIJAY
Copy link
Contributor

Thanks @andrross filing this bug. Looking forward for the fix of this issue.

@Mishail
Copy link

Mishail commented Nov 12, 2024

It may be related to #4494, which I believe makes the index-level ignore_malformed setting override field level

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers Indexing Indexing, Bulk Indexing and anything related to indexing
Projects
None yet
Development

No branches or pull requests

3 participants