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
Closed

Accept dynamic templates with only a match type criteria #3814

bleskes opened this issue Oct 1, 2013 · 0 comments

Comments

@bleskes
Copy link
Contributor

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 as completed in f747704 Oct 1, 2013
bleskes added a commit that referenced this issue Oct 1, 2013
…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
…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
Projects
None yet
Development

No branches or pull requests

1 participant