You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Shai Erera (JIRA)" <ji...@apache.org> on 2011/01/26 12:51:44 UTC

[jira] Closed: (LUCENE-271) Query.toString() and Query.toString(String field) not escaping special characters

     [ https://issues.apache.org/jira/browse/LUCENE-271?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shai Erera closed LUCENE-271.
-----------------------------

    Resolution: Not A Problem
      Assignee:     (was: Lucene Developers)

This is documented by Query.toString() now and according to the comments on the issue, it's not clear that we can handle it consistently across all queries. Given that it's inactive for so long, I'm closing it.

> Query.toString() and Query.toString(String field) not escaping special characters
> ---------------------------------------------------------------------------------
>
>                 Key: LUCENE-271
>                 URL: https://issues.apache.org/jira/browse/LUCENE-271
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>    Affects Versions: 1.4
>         Environment: Operating System: All
> Platform: All
>            Reporter: Romain Laboisse
>            Priority: Minor
>
> The Javadoc says that Query.toString(String field) produces a string 
> representation that is readable by QueryParser.
> QueryParser gives the ability to escape special characters
> + - && || ! ( ) { } [ ] ^ " ~ * ? : \
> with a preceding backslash, but Query.toString() doesn't make any escaping.
> So, QueryParser can parse dc\:title:hugo into a TermQuery with field dc:title 
> and text hugo but toString() gives back dc:title:hugo (which gives a somewhat 
> different result when parsed again, actually a TermQuery with field dc and 
> text title, hugo goes in outer space).

-- 
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