lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "mohammad azadi" <>
Subject QueryParser removes "\" when searching in Persian
Date Sun, 26 Sep 2004 07:42:26 GMT
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

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message