In the query-refactoring branch we noticed weird behaviours related to parsing locales. The two queries affected are query_string and simple_query_string, as they allow users to set the locale used where applicable, depending on the type of lucene query that gets parsed.
Both queries in master parse the locale through our own LocaleUtils#parse method and print it out usingLocale#toString when needed. It turns out that with some locales, our newly added query tests fail given that printing out and reparsing the same locale leads to a different locale. The problem looks very similar to what is explained here: https://issues.apache.org/jira/browse/LUCENE-4021.
I see that we also use LocaleUtils#parse in DateFieldMapper. I think that we should discuss how to address this issue and streamline the solution. I think the best solution would be to parse through Locale#forLanguageTag and print out using Locale#toLanguageTag, but this breaks backwards compatibility it seems. If I make this change SimpleDateMappingTests#testParseLocal fails for instance. Is also our own LocaleUtils still useful?
In the query-refactoring branch we noticed weird behaviours related to parsing locales. The two queries affected are query_string and simple_query_string, as they allow users to set the
localeused where applicable, depending on the type of lucene query that gets parsed.Both queries in master parse the locale through our own
LocaleUtils#parsemethod and print it out usingLocale#toStringwhen needed. It turns out that with some locales, our newly added query tests fail given that printing out and reparsing the same locale leads to a different locale. The problem looks very similar to what is explained here: https://issues.apache.org/jira/browse/LUCENE-4021.I see that we also use
LocaleUtils#parseinDateFieldMapper. I think that we should discuss how to address this issue and streamline the solution. I think the best solution would be to parse throughLocale#forLanguageTagand print out usingLocale#toLanguageTag, but this breaks backwards compatibility it seems. If I make this changeSimpleDateMappingTests#testParseLocalfails for instance. Is also our ownLocaleUtilsstill useful?