Skip to content

Instantly share code, notes, and snippets.

@karmi
Created April 26, 2013 09:14
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 karmi/5465972 to your computer and use it in GitHub Desktop.
Save karmi/5465972 to your computer and use it in GitHub Desktop.
# 2013-04-26 11:13:36:010 [DELETE] ("dis_max_test")
#
curl -X DELETE http://localhost:9200/dis_max_test
# 2013-04-26 11:13:36:011 [404]
#
# {
# "error": "IndexMissingException[[dis_max_test] missing]",
# "status": 404
# }
# 2013-04-26 11:13:36:093 [CREATE] ("dis_max_test")
#
curl -X POST http://localhost:9200/dis_max_test -d '{
}'
# 2013-04-26 11:13:36:093 [200]
#
# {
# "ok": true,
# "acknowledged": true
# }
# 2013-04-26 11:13:36:118 [document/] ("dis_max_test")
#
curl -X POST "http://localhost:9200/dis_max_test/document/" -d '{"title":"It's an Albino, Albino, Albino thing!","text":"Albino, albino, albino! Wanna know about albino? ..."}'
# 2013-04-26 11:13:36:118 [201]
#
# {
# "ok": true,
# "_index": "dis_max_test",
# "_type": "document",
# "_id": "2lB1OeP0SPGiPfcPz_kK9Q",
# "_version": 1
# }
# 2013-04-26 11:13:36:124 [document/] ("dis_max_test")
#
curl -X POST "http://localhost:9200/dis_max_test/document/" -d '{"title":"Albino Vampire Monkey Attacks!","text":"The night was just setting in when ..."}'
# 2013-04-26 11:13:36:125 [201]
#
# {
# "ok": true,
# "_index": "dis_max_test",
# "_type": "document",
# "_id": "Ectd1-nwTr-y0YdfCzKy0Q",
# "_version": 1
# }
# 2013-04-26 11:13:36:137 [document/] ("dis_max_test")
#
curl -X POST "http://localhost:9200/dis_max_test/document/" -d '{"title":"Pinky Elephant","text":"An albino walks into a ZOO and ..."}'
# 2013-04-26 11:13:36:137 [201]
#
# {
# "ok": true,
# "_index": "dis_max_test",
# "_type": "document",
# "_id": "iI__L-EVSa6PpGe7X1yqag",
# "_version": 1
# }
# 2013-04-26 11:13:36:169 [_refresh] ("dis_max_test")
#
curl -X POST "http://localhost:9200/dis_max_test/_refresh"
# 2013-04-26 11:13:36:170 [200]
#
# {
# "ok": true,
# "_shards": {
# "total": 10,
# "successful": 4,
# "failed": 0
# }
# }
# 2013-04-26 11:13:36:197 [_search] (["dis_max_test"])
#
curl -X GET 'http://localhost:9200/dis_max_test/_search?pretty' -d '{
"query": {
"dis_max": {
"queries": [
{
"query_string": {
"query": "albino elephant",
"fields": [
"title",
"text"
]
}
}
]
}
}
}'
# 2013-04-26 11:13:36:198 [200] (23 msec)
#
# {
# "took": 23,
# "timed_out": false,
# "_shards": {
# "total": 5,
# "successful": 5,
# "failed": 0
# },
# "hits": {
# "total": 3,
# "max_score": 0.19070336,
# "hits": [
# {
# "_index": "dis_max_test",
# "_type": "document",
# "_id": "2lB1OeP0SPGiPfcPz_kK9Q",
# "_score": 0.19070336,
# "_source": {
# "title": "It's an Albino, Albino, Albino thing!",
# "text": "Albino, albino, albino! Wanna know about albino? ..."
# }
# },
# {
# "_index": "dis_max_test",
# "_type": "document",
# "_id": "iI__L-EVSa6PpGe7X1yqag",
# "_score": 0.07490275,
# "_source": {
# "title": "Pinky Elephant",
# "text": "An albino walks into a ZOO and ..."
# }
# },
# {
# "_index": "dis_max_test",
# "_type": "document",
# "_id": "Ectd1-nwTr-y0YdfCzKy0Q",
# "_score": 0.044938833,
# "_source": {
# "title": "Albino Vampire Monkey Attacks!",
# "text": "The night was just setting in when ..."
# }
# }
# ]
# }
# }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment