Skip to content

Instantly share code, notes, and snippets.

@jprante
Created October 3, 2013 20:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jprante/6816555 to your computer and use it in GitHub Desktop.
Save jprante/6816555 to your computer and use it in GitHub Desktop.
Anti-phrasing
curl -XDELETE 'http://127.0.0.1:9200/test'
curl -XPOST 'http://127.0.0.1:9200/test/country' -d '{ "country": ["United States"]}'
curl -XPOST 'http://127.0.0.1:9200/test/province' -d '{ "country": ["United States"],"province" : "NY"}'
curl -XPOST 'http://127.0.0.1:9200/test/city' -d '{ "country": ["United States"],"province" : "NY", "city" : "Albany"}'
curl -XPOST 'http://127.0.0.1:9200/test/district' -d '{ "country": ["United States"],"province" : "NY","city" : "Albany","district" : "West Albany"}'
curl -XPOST 'http://127.0.0.1:9200/test/district' -d '{ "country": ["United States"],"province" : "NY","city" : "Albany","district" : "Albany Center"}'
curl -XPOST 'http://127.0.0.1:9200/test/district' -d '{ "country": ["United States"],"province" : "NY","city" : "Albany","district" : "Shopping District"}'
curl -XPOST 'http://127.0.0.1:9200/test/district' -d '{ "country": ["United States"],"province" : "NY","city" : "Albany","district" : "Empirical Mile"}'
curl -XGET 'http://127.0.0.1:9200/test/_refresh'
curl -XGET 'http://127.0.0.1:9200/test/_search?pretty' -d '
{
"query" : {
"query_string" : { "query" : "Albany NY" }
},
"filter" : {
"query" : {
"query_string" : { "query" : "!district:Albany !country:Albany !province:Albany" }
}
}
}
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment