Skip to content

Instantly share code, notes, and snippets.

@azell
Created December 2, 2013 07:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save azell/7746233 to your computer and use it in GitHub Desktop.
Save azell/7746233 to your computer and use it in GitHub Desktop.
Multi-field and string type 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" : "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