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
Add "locale" parameter to query_string and simple_query_string #5131
Conversation
@@ -186,6 +188,13 @@ public Query parse(QueryParseContext parseContext) throws IOException, QueryPars | |||
qpSettings.quoteFieldSuffix(parser.textOrNull()); | |||
} else if ("lenient".equalsIgnoreCase(currentFieldName)) { | |||
qpSettings.lenient(parser.booleanValue()); | |||
} else if ("locale".equals(currentFieldName)) { | |||
String localeStr = parser.text(); | |||
Locale locale = Locale.forLanguageTag(localeStr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this API is java 1.7 only that is why I added public static Locale parseLocale(String locale)
to DateFieldMapper
- I think we should add a utils class somewhere to expose this?
except of the fact that this uses java 1.7 only APIs this looks awesome! |
@@ -71,6 +71,9 @@ both>>. | |||
|
|||
|`lenient` |If set to `true` will cause format based failures (like | |||
providing text to a numeric field) to be ignored. | |||
|
|||
|`locale` | Locale that should be used for string conversions. Defaults to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs a coming[1.1.0]
@s1monw I removed the 1.7-specific APIs from this |
I think this looks great - Can we maybe have a LocaleUtils that has a |
Sounds good, I'll do that. Hopefully going java 7 minimum is not too far out :) |
LGTM +1 to squash and push |
Fixes elastic#5128 Remove java 7 specific Locale functions, add "coming[1.1.0]" to documentation add LocaleUtils utility class for dealing with Locale functions
Merged in 8f8cc72 |
Both default to
Locale.ROOT
Fixes #5128