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

Data mismatch in terms_stats facet #6046

Closed
rbnacharya opened this issue May 5, 2014 · 1 comment
Closed

Data mismatch in terms_stats facet #6046

rbnacharya opened this issue May 5, 2014 · 1 comment

Comments

@rbnacharya
Copy link

My test data and mapping are listed here:

https://gist.github.com/rbnacharya/7acc70b99f758da2162e

Apply the mapping, and add the data...

After that:

I've used a simple facet:

POST http://localhost:9200/testindex/Medical/_search
{
   "size": 0,
   "facets": {
      "totalPaidAmount:top20": {
         "terms_stats": {
            "key_field": "udf21Id",
            "value_field": "paidAmount",
            "size": 20,"order":"total"
         }
      }
   }
}

And,

POST http://localhost:9200/testindex/Medical/_search
{
   "size": 0,
   "facets": {
      "totalPaidAmount:top500": {
         "terms_stats": {
            "key_field": "udf21Id",
            "value_field": "paidAmount",
            "size": 500,"order":"total"

         }
      }
   }
}

The response is not same for some records [count and total] . As you can match results yourself.

In facet top20, There are less documents, but in facet with name containing top500, there are more document counts.

Am I doing wrong? or is it a elasticsearch bug??

@jpountz
Copy link
Contributor

jpountz commented May 5, 2014

This is indeed a known limitation of the terms and terms stats facets, see #1305 for more information. You can improve accuracy by increasing the value of the shard_size parameter at the cost of more memory usage and network traffic.

@jpountz jpountz closed this as completed May 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants