Skip to content

Instantly share code, notes, and snippets.

@drewr
Last active December 15, 2015 10:38
Show Gist options
  • Select an option

  • Save drewr/5246585 to your computer and use it in GitHub Desktop.

Select an option

Save drewr/5246585 to your computer and use it in GitHub Desktop.
curl -s -XDELETE localhost:9200/foo >/dev/null
curl -s -XPUT localhost:9200/foo/t/1 -d'
{
"collections": [
32423,
232,
434
],
"text": "the quick brown fox jumped over the lazy moon"
}'
curl -s -XPUT localhost:9200/foo/t/2 -d'
{
"collections": [
858,
5622,
2
],
"text": "lorem ipsum dolor"
}
'
curl -s -XPOST localhost:9200/foo/_refresh
curl -s localhost:9200/foo/_search -d '
{
"query": {
"match": {
"collections": 232
}
}
}
'
curl -s localhost:9200/foo/_search -d '
{
"query": {
"constant_score": {
"filter": {
"term": {
"collections": 232
}
}
}
}
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment