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

max_score == NaN #263

Closed
clintongormley opened this issue Jul 16, 2010 · 7 comments

Comments

Projects
None yet
2 participants
@clintongormley
Copy link
Member

commented Jul 16, 2010

Hiya

I was incorrect about NaN being valid JSON. Apparently:

Finite numbers are stringified as if by String(number). NaN and Infinity regardless of sign are represented as the string null.

So for situations when there IS no max_score, I'd suggest using zero instead of null or "NaN"

clint

@kimchy

This comment has been minimized.

Copy link
Member

commented Jul 16, 2010

zero is problematic, since it does not indicate a "not valid" max_score, but maybe with a disclaimer that states that you need to check total hits first?

@clintongormley

This comment has been minimized.

Copy link
Member Author

commented Jul 16, 2010

What would be a "not valid" max_score? You could return null but I can't see why that would be useful.

@kimchy

This comment has been minimized.

Copy link
Member

commented Jul 16, 2010

Thats what I meant, there isn't really a non valid score (especially with custom scoring now) that I can return to indicate the fact that there isn't a score associated with this result.

@kimchy

This comment has been minimized.

Copy link
Member

commented Jul 16, 2010

Going to return a null value for the max_score in such cases, will push shortly.

@kimchy

This comment has been minimized.

Copy link
Member

commented Jul 16, 2010

max_score == NaN, closed by e61dc78.

@clintongormley

This comment has been minimized.

Copy link
Member Author

commented Jul 17, 2010

_score should probably also be null rather than NaN

@kimchy

This comment has been minimized.

Copy link
Member

commented Jul 17, 2010

yea, fixed.

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.