Skip to content

Use a custom convertor for GeoOrientation to tolerate alternative options in Elasticsearch #3776

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

Merged
merged 3 commits into from
May 29, 2019

Conversation

codebrain
Copy link
Contributor

The documentation (https://www.elastic.co/guide/en/elasticsearch/reference/current/geo-shape.html) states that there are multiple values possible; 1. Right-hand rule: right, ccw, counterclockwise, 2. Left-hand rule: left, cw, clockwise.

It looks like NEST only supported cw and ccw.

Cluster metadata exposed cw as LEFT in the responses.

@codebrain codebrain requested a review from Mpdreamz May 28, 2019 08:28
@codebrain codebrain self-assigned this May 28, 2019
Copy link
Member

@Mpdreamz Mpdreamz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

converter needs to be internal other than that LGTM 👍

@codebrain
Copy link
Contributor Author

geo_shape_error.txt

Including example cluster metadata state with the transformed LEFT value.

@codebrain codebrain merged commit 7f0ac7c into 6.x May 29, 2019
Copy link
Contributor

@russcam russcam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a comment about use of ToLower()

public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
var enumString = (string)reader.Value;
switch (enumString.ToLower())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

think this should use ToLowerInvariant(), rather than use the current culture

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't make the cut for the merge, but will fix for 7.x

codebrain added a commit that referenced this pull request May 30, 2019
codebrain added a commit that referenced this pull request Jun 7, 2019
@Mpdreamz Mpdreamz deleted the fix/geo-orientation branch June 17, 2019 12:06
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

Successfully merging this pull request may close these issues.

3 participants