-
Notifications
You must be signed in to change notification settings - Fork 25k
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
no buckets returned by terms aggregation on raw field #14161
Comments
Please ask user questions on discuss.elastic.co. We can better help you there. |
@cwithers The type name in your mappings is |
re: dadoonet, I definitely created the index before populating it so that's not it, unfortunately. re: clintongormley, I've tried to change the example here to something non customer data specific and missed one of the uses of "incident". |
Can this be re-opened? it is a real issue that I can reproduce on a clean 1.7.2 Elasticsearch install. It looks like having a field name (fruit) that matches the name of the type (fruit) can confuse Elasticsearch in certain cases. |
Can you share your full script which helps to reproduce it? |
I create the mapping using curl, then load the data using curl, then make the request using curl: curl -XPOST http://elasticsearch:9200/fruit -d @C:\src\Curl\fruit-type.json |
As Clint said, your example is incorrect. Can you send a full correct script that you run on your end and which reproduces the issue? |
The full script is embedded in a lot of Java code, which uses the Elasticsearch REST API to create templates, containg document type metadata and properties, and from the templates timestamped indices. The code also uses the REST API to bulk index the data and to perform searches with lots of aggregations. I can successfully reproduce the strange behaviour with the above curl command to perform the search with only two aggregations directly against Elasticsearch. The above mapping was exported using Elasticsearch's REST API, I only removed the metadata, additional field definitions and renamed "incident" with "fruit". I originally found the issue with Elasticsearch 1.5.1 and to be sure it wasn't already fixed in 1.7.2, I installed 1.7.2 and pointed my Java code at it. Unfortunately, I got the same strange behaviour with one of the terms aggregations. I didn't know about the discussion forum so thanks for pointing that out. |
Yes it can. This is a known issue which is fixed in 2.0 |
See #8870 |
I was aware of that 2.0 change after it being mentioned at Elastic{on} but didn't realise the issue could manifest in this way when there is only one type in an index. Thanks for all your help 😊 |
np :) |
Hi,
I'm getting strange behaviour with a terms aggregation. In the example below, the terms aggregation based on the "fruit" field returns 3 buckets but the aggregation on the "fruit.raw" field returns 0 buckets. I've also tried "fruit.fruit.raw", which returns 3 buckets, as expected.
Am I doing something subtly wrong?
Many Thanks,
Chris
Here is my mapping:
Here is my data:
Here is the working request and response:
Here is the failing request and response:
The text was updated successfully, but these errors were encountered: