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 -
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
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
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
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
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
: 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
-
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
:
: 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
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
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
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
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:
>
> >
---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:/
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
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
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
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
18 matches
Mail list logo