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

Deserialize relation on TotalHits #3667

Merged
merged 1 commit into from
Apr 15, 2019
Merged

Deserialize relation on TotalHits #3667

merged 1 commit into from
Apr 15, 2019

Conversation

russcam
Copy link
Contributor

@russcam russcam commented Apr 15, 2019

This PR deserializes the relation and renames HitsTotal to TotalHits, line with Java source.

TotalHitsFormatter handles both object and numeric representations of TotalHits. When the value is numeric, no relation is present, and there is no simple way to determine what the relation should be. To handle this, Relation is of type TotalHitsRelation?

This commit deserializes the relation and renames HitsTotal to TotalHits, line with Java source.
@russcam russcam added the v7.0.0 label Apr 15, 2019
}

return new TotalHits { Value = value, Relation = relation };
case JsonToken.Number:
Copy link
Contributor

Choose a reason for hiding this comment

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

Mixed format response :(

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is to handle rest_total_hits_as_int=true request parameter

Copy link
Contributor

@codebrain codebrain left a comment

Choose a reason for hiding this comment

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

LGTM

@russcam russcam merged commit dec4e1e into 7.x Apr 15, 2019
@russcam russcam deleted the 7x/total-hits-relation branch April 15, 2019 02:32
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.

2 participants