Trying to fetch document ids with a geohash_grid aggregation


(svartalf) #1

Hi!

I'm trying to make a clustering of geo-points and got stuck with a two
problems.

  1. If bucket contains only one document, is there any way to get it's id?
  2. Is there any way to get only aggregated data from ES with out of a
    'hits' information? It is really a lot of unnecessary data there.

ES version: 1.1.1

Query example:

        {
            "size": 1000,
            "aggregations": {
                'cells': {
                    'geohash_grid': {
                        'field': 'point',
                        'precision': precision,
                    },
                    'aggregations': {
                        'lat': {
                            'avg': {
                                'script': '''doc['point'].lat''',
                            }
                        },
                        'lon': {
                            'avg': {
                                'script': '''doc['point'].lon''',
                            }
                        }
                    }
                }
            },
            'query': {
                'constant_score': {
                    'filter': {
                        'exists': {
                            'field': 'point',
                        }
                    }
                }
            }
        }

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/408a5cb8-9eaa-4f49-a448-ae790722d4e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(ElasticSearch Users mailing list) #2
  1. The upcoming top_hits aggregation "may" help here:

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations-bucket-top-hits-aggregation.html

  1. If you do localhost:9200/_search?search_type=count, the hits will not be
    returned in the most efficient manner possible.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/bab505af-9d3c-4959-a8ef-e563356e9d2c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #3