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

required _routing fails when path points to an integer field #1357

Closed
jeremy opened this issue Sep 23, 2011 · 4 comments
Closed

required _routing fails when path points to an integer field #1357

jeremy opened this issue Sep 23, 2011 · 4 comments

Comments

@jeremy
Copy link

jeremy commented Sep 23, 2011

"_routing": { "required": true, "path":"customer_id" } requires customer_id to be a string.

If the first document has an integer customer_id and no explicit field mapping, it'll raise a routing mismatch.

If customer_id is explicitly mapped as an integer field, it always raises a routing mismatch.

When customer_id is a string (whether implicitly in the first doc or explicitly in the mapping), it works.

Repro at https://gist.github.com/1236728 on ES 0.17.7

@jeremy
Copy link
Author

jeremy commented Sep 23, 2011

@jeremy
Copy link
Author

jeremy commented Sep 23, 2011

routing as string looks to be baked in fairly deeply. So perhaps instead of supporting other types, like integers, a type error should be raised when mapping _routing path to a non-string field.

@kimchy
Copy link
Member

kimchy commented Sep 23, 2011

Heya, yea, it kindda expects the routing to be of type string, though, we should still be able to handle numeric values. Lemme check how we can fix that...

@kimchy kimchy closed this as completed in 9d9133a Sep 23, 2011
@jeremy
Copy link
Author

jeremy commented Sep 26, 2011

Great; even better! Thanks @kimchy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants