-
Notifications
You must be signed in to change notification settings - Fork 800
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
Boolean field returned as integer value in facets #583
Comments
Hi, thank you for the (very detailed) report! The problem is that internally elasticsearch stores booleans as This is a bug where we don't deserialize the aggregation results properly in the I will push a fix soon. |
Fixed in d291eb5 |
It doesn't fix. I think we need to deserialize here. Can you reopen this issue? |
Previous commit only fixed aggregations within aggregations containing |
I'm using ES v5.1.2 and having an issue with the facets returning incorrect types for
Boolean
fields. Here's a minimal setup to reproduce and demonstrate the problem:Now create some documents in the index, and execute a faceted search:
The actual response data looks correct:
That is, we have deserialized Python booleans on the search results. However, the data in the aggregations is incorrect:
The facets should be 3-tuples of (value,count,selected). But boolean values come back as 1 and 0 ( i.e. not deserialized), so the frontend and my templates are not able to distinguish an integer type from a boolean type. To summarise, the expected and actual behaviour are shown below:
Actual behaviour:
Expected behaviour:
What am I doing wrong here? How can we make the facet values for a Boolean field deserialize correctly in the facets, as they do in the actual search results?
The text was updated successfully, but these errors were encountered: