Skip to content

Instantly share code, notes, and snippets.

@clintongormley
Created August 3, 2011 17:09
Show Gist options
  • Save clintongormley/e598ccfd3fa67830b689 to your computer and use it in GitHub Desktop.
Save clintongormley/e598ccfd3fa67830b689 to your computer and use it in GitHub Desktop.
# [Wed Aug 3 19:55:45 2011] Protocol: http, Server: 192.168.5.103:9200
curl -XPUT 'http://127.0.0.1:9200/foo/?pretty=1' -d '
{
"mappings" : {
"bar" : {
"properties" : {
"float" : {
"type" : "float"
},
"int" : {
"type" : "integer"
}
}
}
}
}
'
# [Wed Aug 3 19:55:45 2011] Response:
# {
# "ok" : true,
# "acknowledged" : true
# }
# [Wed Aug 3 19:55:52 2011] Protocol: http, Server: 192.168.5.103:9200
curl -XPOST 'http://127.0.0.1:9200/foo/bar?pretty=1' -d '
{
"float" : 4.56,
"int" : 1.56
}
'
# [Wed Aug 3 19:55:52 2011] Response:
# {
# "ok" : true,
# "_index" : "foo",
# "_id" : "jPdTSl8GShylIr_50JhQbA",
# "_type" : "bar",
# "_version" : 1
# }
# [Wed Aug 3 19:55:55 2011] Protocol: http, Server: 192.168.5.103:9200
curl -XGET 'http://127.0.0.1:9200/foo/_search?pretty=1' -d '
{
"facets" : {
"float" : {
"terms" : {
"field" : "float"
}
},
"int" : {
"terms" : {
"field" : "int"
}
},
"all" : {
"terms" : {
"field" : "_all"
}
}
},
"size" : 0
}
'
# [Wed Aug 3 19:55:55 2011] Response:
# {
# "hits" : {
# "hits" : [],
# "max_score" : 1,
# "total" : 1
# },
# "timed_out" : false,
# "_shards" : {
# "failed" : 0,
# "successful" : 5,
# "total" : 5
# },
# "facets" : {
# "float" : {
# "other" : 0,
# "terms" : [
# {
# "count" : 1,
# "term" : 4.56
# }
# ],
# "missing" : 0,
# "_type" : "terms",
# "total" : 1
# },
# "int" : {
# "other" : 0,
# "terms" : [
# {
# "count" : 1,
# "term" : 1
# }
# ],
# "missing" : 0,
# "_type" : "terms",
# "total" : 1
# },
# "all" : {
# "other" : 0,
# "terms" : [
# {
# "count" : 1,
# "term" : "4.56"
# },
# {
# "count" : 1,
# "term" : "1.56"
# }
# ],
# "missing" : 0,
# "_type" : "terms",
# "total" : 2
# }
# },
# "took" : 2
# }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment