Skip to content

Instantly share code, notes, and snippets.

@tebriel
Created December 30, 2014 17:06

Revisions

  1. tebriel created this gist Dec 30, 2014.
    18 changes: 18 additions & 0 deletions aggregation_request
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    POST /pindrop/_search HTTP/1.1
    Content-Type: application/json
    Host: logstash.local:9200
    Connection: close
    User-Agent: Paw/2.1.1 (Macintosh; OS X/10.10.2) GCDHTTPRequest
    Content-Length: 209

    {
    size: 0,
    "aggregations" : {
    "myLarge-GrainGeoHashGrid" : {
    "geohash_grid" : {
    "field" : "location",
    "precision" : 3
    }
    }
    }
    }
    19 changes: 19 additions & 0 deletions aggregation_response.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    {
    "_shards": {
    "failed": 0,
    "successful": 1,
    "total": 1
    },
    "aggregations": {
    "myLarge-GrainGeoHashGrid": {
    "buckets": []
    }
    },
    "hits": {
    "hits": [],
    "max_score": 0.0,
    "total": 3336419
    },
    "timed_out": false,
    "took": 103
    }
    20 changes: 20 additions & 0 deletions es_template.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    {
    "template_pindrop": {
    "aliases": {},
    "mappings": {
    "call_location": {
    "properties": {
    "location": {
    "type": "geo_point"
    }
    }
    }
    },
    "order": 0,
    "settings": {
    "index.number_of_replicas": "0",
    "index.number_of_shards": "1"
    },
    "template": "pindrop*"
    }
    }
    25 changes: 25 additions & 0 deletions example_record.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    {
    "_index": "pindrop_rev3",
    "_type": "api",
    "_id": "AUqcIyssv_-yUajZ4iIN",
    "_score": 1,
    "_source": {
    "@version": "1",
    "@timestamp": "2014-12-01T22:36:09.000Z",
    "call_location_geojson": [
    -73.045803,
    41.551994
    ],
    "call_location": {
    "location": {
    "lat": 41.551994,
    "lon": -73.045803
    }
    }
    },
    "fields": {
    "@timestamp": [
    1417473369000
    ]
    }
    }