[ http://issues.apache.org/jira/browse/LUCENE-412?page=comments#action_12451087 ] Michael Busch commented on LUCENE-412: --------------------------------------
I tried to reproduce this problem. I create an index in a RAMDirectory, add two documents with content "tina" and "~tina", using Field.Index.TOKENIZED and search for "\\~tina" using the QueryParser and IndexSearcher. If I use Simple- or StandardAnalyzer (for both IndexWriter and QueryParser) I get two results, which is correct, because both analyzers drop the ~. However, the WhitespaceAnalyzer doesn't drop the ~ and consequently I get only one result. So I think this is not reproducable (anymore). I suggest to close this issue, especially since nobody commented on it for over a year. > Escaping special characters in Query doesn't return correct results. > -------------------------------------------------------------------- > > Key: LUCENE-412 > URL: http://issues.apache.org/jira/browse/LUCENE-412 > Project: Lucene - Java > Issue Type: Bug > Components: Search > Affects Versions: 1.4 > Environment: Operating System: Linux > Platform: Other > Reporter: Sathya K > Assigned To: Lucene Developers > > I was using the sample code available with the download and I added in two > files: > FileOne with text: tina > FileTwo with text: ~tina > I was trying the Searcher.java (sample code) and trying to search for > "\\~tina" > (match only documents containing the exact text ~tina). And lucene always > reports hits in both the documents. > I tried Standard, Simple and Whitespace Analyzers with the QueryParser and > with > all of them the result is the same. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]