Skip to content

Dynamic templates ignore analyzers on keyword fields silently #17411

@clintongormley

Description

@clintongormley

The following:

PUT t
{
  "mappings": {
    "t": {
      "dynamic_templates": [
        {
          "strings": {
            "match_mapping_type": "string",
            "mapping": {
              "analyzer": "english",
              "type": "keyword"
            }
          }
        }
      ]
    }
  }
}

PUT t/t/1
{
  "foo": "bar"
}

creates a keyword field without an analyzer, which is good. However, I would have expected it to throw an exception about the presence of the analyzer setting.

Metadata

Metadata

Assignees

Labels

:Search Foundations/MappingIndex mappings, including merging and defining field types>bugTeam:Search FoundationsMeta label for the Search Foundations team in Elasticsearch

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions