public
Last active

  • Download Gist
gistfile1.sh
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
curl -XDELETE localhost:9200/test
curl -XPUT localhost:9200/test -d '{
"mappings" : {
"demo" : {
"properties" : {
"demostring" : {
"type" : "string",
"analyzer" : "whitespace"
}
}
}
}
}'
 
curl -XPUT localhost:9200/test/demo/1 -d '{
"demostring" : "One/Two"
}'
 
curl -XPUT localhost:9200/test/demo/2 -d '{
"demostring" : "One Two"
}'
 
curl localhost:9200/test/_search -d '{
"query" : {
"match_all" : {}
},
"facets" : {
"demostring" : {
"terms" : {
"field" : "demostring"
}
}
}
}'

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.