lucenenet-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Umer Khalid Qureshi <omer.kha...@gmail.com>
Subject Re: How Can I Deal with Special Chars like #, /,
Date Thu, 11 Nov 2010 11:58:23 GMT
Well, I am facing the same problem
I am though using standardanalyzer as following:

analyzer = new Lucene.Net.Analysis.Standard.StandardAnalyzer(new string[] {
"" });

and the search query i am doing is like  *"ri*k fac*r"~3*
but when i parse it through query parser,

QueryParser queryParser = new
QueryParser(Lucene.Net.Util.Version.LUCENE_29,"Contents", analyzer);
queryParser.Parse(*"\"ri*k fac*r\"~3"*);

it replaced '*' with empty space and results as *"ri k fac r"~3*

I tried following too
queryParser.Parse(*"\"ri\\*k fac\\*r\"~3"*);
but of no use.

Can you guide us how to escape them ?

P.S: when i use Whitespaceanalyzer, the parsing become just fine and results
as i expect. but i can't use whiteSpaceAnalyzer.







2010/11/11 Pál Barnabás <pbarni@gmail.com>

> Hi,
> Check the 'Escaping Special Characters' section in the query parser
> document:
> http://lucene.apache.org/java/2_9_1/queryparsersyntax.html
>
> 2010/11/11 K a r n a <karunakerreddyv@gmail.com>:
> > How can I search when my search term contains #, /, &. $, @,
> > ',(,),{,},[,],|,\-,+,=,*,!,~,`....etc
> >
> > for example If I want to search C#, Asp.net, Accounting/ Audinting,
> > Banking & Financial...
> > How I can prepare a search query for the above keywords
> > ...
> > Please let me know if anyone knows the solution...I'm doing trial and
> > error from past 1 month....
> > still I'm unable to find the solution.
> >
> >
> > --
> > Thanks & Regards,
> > Karunaker Reddy V
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message