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

Remove support for type, fields, copy_to and boost in metadata field definition #116944

Merged

Conversation

javanna
Copy link
Member

@javanna javanna commented Nov 18, 2024

Support for type, fields, copy_to and boost in metadata field definition has been deprecated in #90989. Such fields have been long parsed and silently ignored.

This commit removes support for their parsing.

…definition

Support for type, fields, copy_to and boost in metadata field definition has been
deprecated in elastic#90989. Such fields have been long parsed and silently ignored.

This commit removes support for their parsing.
@javanna javanna added :Search Foundations/Mapping Index mappings, including merging and defining field types >breaking labels Nov 18, 2024
@javanna javanna marked this pull request as ready for review November 18, 2024 15:21
@elasticsearchmachine elasticsearchmachine added the Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch label Nov 18, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-search-foundations (Team:Search Foundations)

@elasticsearchmachine
Copy link
Collaborator

Hi @javanna, I've created a changelog YAML for you. Note that since this PR is labelled >breaking, you need to update the changelog YAML to fill out the extended information sections.

@drempapis
Copy link
Contributor

drempapis commented Nov 19, 2024

I tried to add the copy_to into _routing metadata field,

PUT /index
{
  "mappings": {
    "_routing": {
      "copy_to" : "any"
    },
    "properties": {
      "name": {
        "type": "text"
      }
    }
  }
}

Which adds a warning under the *_deprecation.json file (main branch)

Executing the same request and applying the PR changes, I get the response, which seems ok to me.

{
    "error": {
        "root_cause": [
            {
                "type": "mapper_parsing_exception",
                "reason": "unknown parameter [copy_to] on metadata field [_routing]"
            }
        ],
        "type": "mapper_parsing_exception",
        "reason": "Failed to parse mapping: unknown parameter [copy_to] on metadata field [_routing]",
        "caused_by": {
            "type": "mapper_parsing_exception",
            "reason": "unknown parameter [copy_to] on metadata field [_routing]"
        }
    },
    "status": 400
}

@javanna
Copy link
Member Author

javanna commented Nov 19, 2024

Thanks for the testing @drempapis and the review ! Indeed, these fields received special treatment before because they could potentially be provided, although without taking any effect. With my change, they get the same treatment as any other unknown field.

@javanna javanna merged commit 8a7491c into elastic:main Nov 19, 2024
16 checks passed
@javanna javanna deleted the breaking/unsupported_params_metadata_fields branch November 19, 2024 14:44
rjernst pushed a commit to rjernst/elasticsearch that referenced this pull request Nov 20, 2024
…definition (elastic#116944)

Support for type, fields, copy_to and boost in metadata field definition has been
deprecated in elastic#90989. Such fields have been long parsed and silently ignored.
alexey-ivanov-es pushed a commit to alexey-ivanov-es/elasticsearch that referenced this pull request Nov 28, 2024
…definition (elastic#116944)

Support for type, fields, copy_to and boost in metadata field definition has been
deprecated in elastic#90989. Such fields have been long parsed and silently ignored.
cbuescher added a commit to cbuescher/elasticsearch that referenced this pull request Dec 17, 2024
We removed support for type, fields, copy_to and boost in metadata field
definitions with elastic#116944 but with the move towards supporting N-2
read-only indices we need to add them back. This change reverts previous
removal commits and adapts tests to also check we now throw errors for
newly created indices.
cbuescher added a commit that referenced this pull request Dec 18, 2024
We removed support for type, fields, copy_to and boost in metadata field
definitions with #116944 but with the move towards supporting N-2
read-only indices we need to add them back. This change reverts previous
removal commits and adapts tests to also check we now throw errors for
newly created indices.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>breaking :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants