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

Accept dynamic templates with only a match type criteria #3814

Closed
bleskes opened this Issue Oct 1, 2013 · 0 comments

Comments

Projects
None yet
1 participant
@bleskes
Copy link
Member

bleskes commented Oct 1, 2013

If some wants all strings in an index to default to not_analyzed, you can do that via the dynamic template settings:

curl -XPUT "http://localhost:9200/index" -d'
{
   "mappings": {
      "_default_": {
         "dynamic_templates": [
            {
               "test": {
                  "match_mapping_type": "string",
                  "match": "*", // <- not needed when we have 'match_mapping_type'
                  "mapping": {
                      "index": "not_analyzed"
                  }
               }
            }
         ]
      }
   }
}'

However, if you remove the "match":"*", you get the following error:

{
   "error": "MapperParsingException[mapping [_default_]]; nested: MapperParsingException[template must have match or path_match set]; ",
   "status": 400
}

A minor issue but if one specifies match_mapping_type, we can default match to *

@ghost ghost assigned bleskes Oct 1, 2013

@bleskes bleskes closed this in f747704 Oct 1, 2013

bleskes added a commit that referenced this issue Oct 1, 2013

Allow dynamic templates with match_mapping_type but no path_match or …
…match.

As long as we have some selector we're good.

Closes #3814

mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015

Allow dynamic templates with match_mapping_type but no path_match or …
…match.

As long as we have some selector we're good.

Closes elastic#3814
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.