You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have setup kibana for elastic search and in dev tools, I have been querying data but getting incorrect results.
My Elastic search data is generated by a food ordering app, so basically, the structure of data is like I am fetching all those orders and inside each order, I have menu items and its count.
For example, I will be using a single menu item (i.e Boil Egg )here for elaboration.
So below is my query to get the items to count for "Boil Egg" menu item
Note: I tried with the script as well but getting the same result script: "doc['data.items.menuitem.keyword'].value"
I know with this query there are two orders that will be pulled by an elastic search query.
In the first order, you can see data.items array has only one item i.e Boil Egg and the count is 2, whereas in second-order you can see data.items array has two items one is Boil Egg with count 1 and another is Dal Rice with count 1.
So I am querying elastic search to just return me the count & total price of Boil Egg irrespective of how many items we have in the array.
So what is happening, I am bucketing the menu item but while aggregating it is considering the count and total price of second item i.e Dal Rice in second-order details.
This should not be the case. I have tried many things searched on internet but was not able to get the proper solution for this.
I am not sure whether this is a bug or there is some feature in ES that I am missing over here.
The text was updated successfully, but these errors were encountered:
Thanks very much for your interest in Elasticsearch and spending the time writing a well formatted question.
This appears to be a user question, and we'd like to direct these kinds of things to the forums. If you can stop by there, we'd appreciate it. This allows us to use GitHub for verified bug reports, feature requests, and pull requests.
There's an active community in the forums that should be able to help get an answer to your question. As such, I hope you don't mind that I close this.
I have setup kibana for elastic search and in dev tools, I have been querying data but getting incorrect results.
My Elastic search data is generated by a food ordering app, so basically, the structure of data is like I am fetching all those orders and inside each order, I have menu items and its count.
For example, I will be using a single menu item (i.e Boil Egg )here for elaboration.
So below is my query to get the items to count for "Boil Egg" menu item
:
Note: I tried with the script as well but getting the same result
script: "doc['data.items.menuitem.keyword'].value"
I know with this query there are two orders that will be pulled by an elastic search query.
Order 1 :
Order 2:
In the first order, you can see data.items array has only one item i.e Boil Egg and the count is 2, whereas in second-order you can see data.items array has two items one is Boil Egg with count 1 and another is Dal Rice with count 1.
So I am querying elastic search to just return me the count & total price of Boil Egg irrespective of how many items we have in the array.
So the expected output is :
Actual Output is:
So what is happening, I am bucketing the menu item but while aggregating it is considering the count and total price of second item i.e Dal Rice in second-order details.
This should not be the case. I have tried many things searched on internet but was not able to get the proper solution for this.
I am not sure whether this is a bug or there is some feature in ES that I am missing over here.
The text was updated successfully, but these errors were encountered: