Skip to content

Instantly share code, notes, and snippets.

@monken
Created July 27, 2011 09:15
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 monken/1108986 to your computer and use it in GitHub Desktop.
Save monken/1108986 to your computer and use it in GitHub Desktop.
curl -XDELETE localhost:9200/test
curl -XPUT localhost:9200/test
curl -XPUT localhost:9200/test/file/_mapping -d '
{
"file" : {
"properties" : {
"name" : {
"fields" : {
"analyzed" : {
"store" : "yes",
"type" : "string",
"analyzer" : "standard",
"include_in_all" : false
},
"name" : {
"index" : "not_analyzed",
"store" : "yes",
"type" : "string"
}
},
"type" : "multi_field"
}
}
}
}'
curl localhost:9200/_refresh
# fails
curl localhost:9200/test/file/_search -d '{
"query" : {
"query_string" : {
"fields" : [
"file.name.analyzed"
],
"query" : "test in"
}
}
}'
# succeeds
curl localhost:9200/test/file/_search -d '{
"query" : {
"query_string" : {
"fields" : [
"file.name.analyzed"
],
"query" : "test"
}
}
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment