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

Incompatibility with ElasticSearch 1.0 when using .Fields() #481

Closed
khaledh opened this issue Feb 21, 2014 · 2 comments
Closed

Incompatibility with ElasticSearch 1.0 when using .Fields() #481

khaledh opened this issue Feb 21, 2014 · 2 comments

Comments

@khaledh
Copy link

khaledh commented Feb 21, 2014

According to elastic/elasticsearch#4542 there has been a change to the JSON returned by ES when using the fields search option. The change forces all fields to be returned as an array, even if the field is single-valued. This causes a JSON deserialization exception: Error reading integer. Unexpected token: StartArray. because the deserializer expects a single value, but actually encounters an array.

In a way this is similar to the issue in #227, but in that issue it was the opposite problem: expecting an array but sometimes encountering single values.

It looks like this can be worked around by adding a custom JSON converter to handle the case when fields are returned as arrays, but I think this should be handled internally by NEST. No?

@Mpdreamz
Copy link
Member

Hi @khaledh this is very true, the upcoming release that adds support for the 1.0 elasticsearch release has support for this and the new source include/exclude (http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-source-field.html#include-exclude) which sort of take the place of the old fields mechanism (only better).

NEST 0.9.12.0 is NOT compatible with 1.0.

Thanks for reporting, keep'm comming 👍

@khaledh
Copy link
Author

khaledh commented Feb 21, 2014

Thanks for the update @Mpdreamz. I managed to work-around the problem by writing a custom JSON converter for now.

Keep up the good work!

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