Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aggregations: Geohash grid should count documents only once #8512

Closed
jpountz opened this issue Nov 17, 2014 · 2 comments

Comments

Projects
None yet
2 participants
@jpountz
Copy link
Contributor

commented Nov 17, 2014

If two geo-hashes of the same document fall into the same bucket, then the document count for this bucket will be incremented by 2 instead of 1. Here is a reproduction:

DELETE test

PUT test
{
  "mappings": {
    "test": {
      "properties": {
        "points": {
          "type": "geo_point"
        }
      }
    }
  }
}

PUT test/test/1
{
  "points": [
    "1,2",
    "2,3"
  ]
}

GET /test/_search?search_type=count
{
  "aggs": {
    "grid": {
      "geohash_grid": {
        "field": "points",
        "precision": 2
      }
    }
  }
}

which returns:

{
   "took": 3,
   "timed_out": false,
   "_shards": {
      "total": 5,
      "successful": 5,
      "failed": 0
   },
   "hits": {
      "total": 1,
      "max_score": 0,
      "hits": []
   },
   "aggregations": {
      "grid": {
         "buckets": [
            {
               "key": "s0",
               "doc_count": 2
            }
         ]
      }
   }
}
@ejain

This comment has been minimized.

Copy link
Contributor

commented Nov 17, 2014

btw the geohash grid aggregation fails in 1.4.0 if documents with more than one value are present, see #8507

@jpountz

This comment has been minimized.

Copy link
Contributor Author

commented Nov 17, 2014

Indeed, I found this issue while working on a fix for that issue! :) #8513

jpountz added a commit to jpountz/elasticsearch that referenced this issue Nov 20, 2014

jpountz added a commit that referenced this issue Nov 21, 2014

@jpountz jpountz closed this in abc0bc4 Nov 21, 2014

mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015

mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.