Created
November 11, 2014 06:46
-
-
Save loren/cde1aded2f86950f2cc4 to your computer and use it in GitHub Desktop.
index.query.parse.allow_unmapped_fields setting does not seem to allow unmapped fields in alias filters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# verify we are allowing unmapped fields | |
curl -s -XGET '/_nodes?pretty=true' | grep allow_unmapped | |
# "allow_unmapped_fields" : "true" | |
# delete the index | |
curl -XDELETE 127.0.0.1:9200/test1 | |
# create index with explicit mapping only for user field | |
curl -XPUT 127.0.0.1:9200/test1 -d ' | |
{ | |
"mappings": { | |
"type1": { | |
"properties": { | |
"user" : { | |
"type": "string", | |
"index": "not_analyzed" | |
} | |
} | |
} | |
} | |
}' | |
# try to create alias with filter on unmapped field | |
curl -XPOST 127.0.0.1:9200/_aliases -d ' | |
{ | |
"actions": [ | |
{ | |
"add": { | |
"index": "test1", | |
"alias": "alias4", | |
"filter": { | |
"term": { | |
"unknownfield": "kimchy" | |
} | |
} | |
} | |
} | |
] | |
}' | |
# {"error":"ElasticsearchIllegalArgumentException[failed to parse filter for alias [alias4]]; nested: QueryParsingException[[test1] Strict field resolution and no field mapping can be found for the field with name [unknownfield]]; ","status":400} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment