You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by mohammad azadi <re...@email.com> on 2004/09/26 09:42:26 UTC

QueryParser removes "\" when searching in Persian

To be able to search in Persian, I convert the original query from a form field which is in the XML CharRefs formt, e.g. "&#1575;&#1610;&#1585;&#1575;&#1606;", to "\u0627\u064a\u0631\u0627\u0646". since all websites i am indexing are using XML CharRefs it makes it possible to search in Persian. but when making a Query from "\u0627\u064a\u0631\u0627\u0646", it seems that QueryParser removes all backslashes (\). 

String qry = SomeExternalParser.parse("someQuery");
which will return : qry = "\u0627\u064a\u0631\u0627\u0646"

QueryParser queryParser = new QueryParser("fieldName", new StandardAnalyzer());
Query query = queryParser.parse(qry);

now query.toString() shows: [filedName]:"u0627u064au0631u0627u0646"

how can i prevent QueryParser doing this? i should mention that if i write the query as an String such as: String qry = "\u0627\u064a\u0631\u0627\u0646", then it works fine. but when i try to get the qry from another method or class, this strange behavior happens. 

cheers, reza

-- 
___________________________________________________________
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm


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