You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Robert Muir (JIRA)" <ji...@apache.org> on 2010/04/22 19:37:50 UTC

[jira] Commented: (LUCENE-2411) clean up uses of String.toLowerCase in code

    [ https://issues.apache.org/jira/browse/LUCENE-2411?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12859915#action_12859915 ] 

Robert Muir commented on LUCENE-2411:
-------------------------------------

by the way, the most confusing example of this is the queryparser: which takes a Locale parameter, but doesnt even use it for this operation, instead using the default.

> clean up uses of String.toLowerCase in code
> -------------------------------------------
>
>                 Key: LUCENE-2411
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2411
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 3.1
>            Reporter: Robert Muir
>             Fix For: 3.1
>
>
> Uwe recently fixed this in the ThaiWordFilter, which reminded me to search our code for use of String.toLowerCase()
> The problem with this method is the following:
> * it depends on the "default locale" which is flimsy and should be avoided I think, it typically just causes problems.
>   This is because there can be hard-to-debug issues if the machine is not configured correctly for the same Locale
>   at both index and query time.
> * lowercasing with locale-sensitive rules is really only suitable for display and presentation, 
>   if we want international lowercasing for search we should be using case folding.
>   This is especially important since otherwise people unknowingly using this special casing at query-time are
>   not going to get results, e.g. if they use a TermRangeQuery from the queryparser and it lowercases stuff differently.
> in my opinion we should fix all these methods to use Character.toLowerCase
> (if possible especially for speed with TokenStreams), otherwise String.toLowerCase 
> with the ROOT Locale, new Locale(""). This is closer to case folding.
> If some things really need locale-sensitivity for some extreme reason I think we should just make the Locale 
> a mandatory parameter.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org