Skip to content

Instantly share code, notes, and snippets.

@azell
Created December 2, 2013 07:29
Show Gist options
  • Save azell/7746253 to your computer and use it in GitHub Desktop.
Save azell/7746253 to your computer and use it in GitHub Desktop.
Multi-field and string type with embedded value not working as expected
curl -XDELETE localhost:9200/test
curl -XPUT localhost:9200/test -d '{
"mappings" : {
"type1" : {
"properties" : {
"name" : {
"type" : "multi_field",
"fields" : {
"name" : {"type" : "string", "index" : "analyzed"},
"untouched" : {"type" : "string", "index" : "not_analyzed"}
}
}
}
}
}
}'
curl -XPUT localhost:9200/test/type1/1 -d '{
"name" : {
"value" : "test me"
}
}'
curl -XPOST localhost:9200/test/_refresh
curl -XGET localhost:9200/test/_search?q=name.untouched:*
curl -XGET localhost:9200/test/_search -d '{
"query": {
"match": {
"name" : {
"query" : "test me",
"type" : "phrase"
}
}
}
}'
curl -XGET localhost:9200/test/_search -d '{
"query": {
"match": {
"name.untouched" : {
"query" : "test me",
"type" : "phrase"
}
}
}
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment