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 vibhuti <vi...@thePSI.com> on 2009/09/10 12:47:51 UTC
Problem in lucene query
Hello
I am new to Lucene and facing a problem while performing searches. I am
using lucene 2.2.0.
My application indexes documents on "keyword" field which contains integer
values. If the value is negative the query does not return correct results.
Following is my lucene query:
(keyword: \-1)
I also tried:
(keyword: "-1")
But none of them returns correct results. It seems that Lucene ignores '-'.
My purpose is to search documents with index value "-1".
Any ideas??
Thanks
Re: Problem in lucene query
Posted by Erick Erickson <er...@gmail.com>.
Also, get a copy of Luke and examine your index, that'll tell you what
isactually
in there *and* it will let you see how queries parse under
various analyzers.....
Best
Erick
On Thu, Sep 10, 2009 at 6:47 AM, vibhuti <vi...@thepsi.com> wrote:
> Hello
>
>
>
> I am new to Lucene and facing a problem while performing searches. I am
> using lucene 2.2.0.
>
> My application indexes documents on "keyword" field which contains integer
> values. If the value is negative the query does not return correct results.
>
>
>
> Following is my lucene query:
>
>
>
> (keyword: \-1)
>
>
>
> I also tried:
>
> (keyword: "-1")
>
>
>
>
>
> But none of them returns correct results. It seems that Lucene ignores '-'.
> My purpose is to search documents with index value "-1".
>
>
>
> Any ideas??
>
>
>
> Thanks
>
>
Re: Problem in lucene query
Posted by Anshum <an...@gmail.com>.
Hi Vibhuti,
Not in sync with your query, but I'd advice you to graduate you to a rather
recent lucene release. Something like 2.4.1 or atleast a 2.3.1 [Considering
its already time for 2.9].
--
Anshum Gupta
Naukri Labs!
http://ai-cafe.blogspot.com
The facts expressed here belong to everybody, the opinions to me. The
distinction is yours to draw............
On Thu, Sep 10, 2009 at 4:17 PM, vibhuti <vi...@thepsi.com> wrote:
> Hello
>
>
>
> I am new to Lucene and facing a problem while performing searches. I am
> using lucene 2.2.0.
>
> My application indexes documents on "keyword" field which contains integer
> values. If the value is negative the query does not return correct results.
>
>
>
> Following is my lucene query:
>
>
>
> (keyword: \-1)
>
>
>
> I also tried:
>
> (keyword: "-1")
>
>
>
>
>
> But none of them returns correct results. It seems that Lucene ignores '-'.
> My purpose is to search documents with index value "-1".
>
>
>
> Any ideas??
>
>
>
> Thanks
>
>