Re: Escaping Special Characters

2011-07-05 Thread Adriano Crestani
Hi Govind, I think you are wrong by assuming escape should receive a query string as parameter. However, it's meant to receive a term as parameter, which will later be used to create a query. See the example below: // this is bad, since +, &, * and - will be escaped String query = "+lucene&solr -

Re: Escaping Special Characters

2011-07-05 Thread govind bhardwaj
Hi, I'm not getting you. escape() method takes String as an argument. The code snippet I am using is as follows *String escaped = MultiFieldQueryParser.escape(queryString); Query query1 = parser.parse(escaped); TopDocs results = searcher.search(query1); *Please point out where I may be going wro

Re: Escaping Special Characters

2011-07-04 Thread Adriano Crestani
Hi Govind, escape() method should only be used to escape term, not the query itself. If the user is entering the query, it's his responsibility to escape the query. On Mon, Jul 4, 2011 at 4:21 AM, govind bhardwaj wrote: > Hi, > > I am using Lucene version 3.1 > Previously I had trouble regardin

Re: escaping special characters

2008-08-11 Thread Mark Miller
Steven A Rowe wrote: On 08/11/2008 at 2:14 PM, Chris Hostetter wrote: Aravind R Yarram wrote: can i escape built in lucene keywords like OR, AND aswell? as of the last time i checked: no, they're baked into the grammer. I have not tested this, but I've read somewhere on t

Re: escaping special characters

2008-08-11 Thread Matthew Hall
You can simply change your input string to lowercase before passing it to the analyzers, which will give you the effect of escaping the boolean operators. (I.E you will now search on and or and not) Remember however that these are extremely common words, and chances are high that you are remo

RE: escaping special characters

2008-08-11 Thread Steven A Rowe
On 08/11/2008 at 2:14 PM, Chris Hostetter wrote: > Aravind R Yarram wrote: > > can i escape built in lucene keywords like OR, AND aswell? > > as of the last time i checked: no, they're baked into the grammer. I have not tested this, but I've read somewhere on this list that enclosing OR and AND

Re: escaping special characters

2008-08-11 Thread Chris Hostetter
: can i escape built in lucene keywords like OR, AND aswell? as of the last time i checked: no, they're baked into the grammer. (that may have changed when it switchedfrom a javac to a flex grammer though, so i'm not 100% positive) -Hoss -

Re: escaping special characters

2008-08-06 Thread Aravind . Yarram
can i escape built in lucene keywords like OR, AND aswell? Regards, Aravind R Yarram Chris Hostetter <[EMAIL PROTECTED]> 08/06/2008 07:05 PM Please respond to java-user@lucene.apache.org To java-user@lucene.apache.org cc Subject Re: escaping special characters :

Re: escaping special characters

2008-08-06 Thread Chris Hostetter
: String escapedKeywords = QueryParser.escape(keywords); : Query query = new QueryParser("content", new : StandardAnalyzer()).parse(escapedKeywords); : : this works with most of the special characters like * and ~ except \ . I : can't do a search for a keyword like "ho\w" and get results. : am I

RE: Escaping special characters

2007-09-30 Thread Tom Conlon
Hi, In case this is of help to others: Crux of problem: I wanted numbers and characters such as # and + to be considered. Solution: implement a LowercaseWhitespaceAnalyzer and a LowercaseWhitespaceTokenizer. Tom === Diagnostic

Re: Escaping special characters

2007-09-23 Thread Erick Erickson
ed > > Enter Querystring: > (c++ and c#) > Searching for: c c > > Enter Querystring: > (c\+\+ and c\#) > Searching for: c c > > -Original Message- > From: Erick Erickson [mailto:[EMAIL PROTECTED] > Sent: 23 September 2007 14:47 > To: java-user@lucene.a

RE: Escaping special characters

2007-09-23 Thread Tom Conlon
ailto:[EMAIL PROTECTED] Sent: 23 September 2007 14:47 To: java-user@lucene.apache.org Subject: Re: Escaping special characters Default as in StandardAnalyzer? "Stuff happens" with StandardAnalyzer. I'd recommend that you use something really simple like WhitespaceAnalyzer for something li

Re: Escaping special characters

2007-09-23 Thread Erick Erickson
7;ll try. > > Tom > > -Original Message- > From: Karl Wettin [mailto:[EMAIL PROTECTED] > Sent: 23 September 2007 10:39 > To: java-user@lucene.apache.org > Subject: Re: Escaping special characters > > > 23 sep 2007 kl. 10.53 skrev Tom Conlon: > > >

RE: Escaping special characters

2007-09-23 Thread Tom Conlon
---Original Message- From: Karl Wettin [mailto:[EMAIL PROTECTED] Sent: 23 September 2007 10:39 To: java-user@lucene.apache.org Subject: Re: Escaping special characters 23 sep 2007 kl. 10.53 skrev Tom Conlon: > > Unless I'm missing something, according to: > > http:/

Re: Escaping special characters

2007-09-23 Thread Karl Wettin
23 sep 2007 kl. 10.53 skrev Tom Conlon: Unless I'm missing something, according to: http://lucene.apache.org/java/docs/queryparsersyntax.html#Escaping% 20Spe cial%20Characters I should be able to search for C++ and C# using something like: C\+\+ and C\#. That is correct. This doesn't

Re: Escaping special characters

2005-04-07 Thread Andy Roberts
On Thursday 07 Apr 2005 06:38, Chuck Williams wrote: > Mufaddal Khumri writes (4/6/2005 11:21 PM): > >Hi, > > > >Am new to Lucene. I found the following page: > >http://lucene.apache.org/java/docs/queryparsersyntax.html. At the bottom > >of the page there is a section that in order to escape specia

RE: Escaping special characters

2005-04-06 Thread Mufaddal Khumri
Analyzer? Thanks. -Original Message- From: Chuck Williams [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 06, 2005 11:39 PM To: java-user@lucene.apache.org Subject: Re: Escaping special characters Mufaddal Khumri writes (4/6/2005 11:21 PM): >Hi, > > > >Am new to Luce

Re: Escaping special characters

2005-04-06 Thread Chuck Williams
Mufaddal Khumri writes (4/6/2005 11:21 PM): Hi, Am new to Lucene. I found the following page: http://lucene.apache.org/java/docs/queryparsersyntax.html. At the bottom of the page there is a section that in order to escape special characters one would use "\". I have an Indexer that indexes produc