Skip to content

Instantly share code, notes, and snippets.

@loren
Created November 11, 2014 06:46
Show Gist options
  • Save loren/cde1aded2f86950f2cc4 to your computer and use it in GitHub Desktop.
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
# 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