lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From javier muguruza <jmugur...@gmail.com>
Subject Re: all stop words in exact phrase get 0 hits
Date Thu, 15 Dec 2005 15:34:55 GMT
thanks all,

Yes, I know + means it must be true, but the phrase goes through the
same analyzer, so stop words are removed....

I made some debugging and I got this:
Query query = QueryParser.parse(searchexp, "body", LuceneHelper.getAnalyzer());

If searchexp is
((+(body:"I have")) OR (+(attachments:"I have")))
query .toString() is
(+()) (+())

but if searchexp is
+body:"I have" OR +attachments:"I have"
query .toString() is blank

so that makes it work differently I think. I have lots of parenthesis
cause I build the string by code from multiple UI boxes etc, to make
sure ands and ors are properly handled.

As i said i can overcome that by code, but I think that is a bug no?
it shoudl realize (+()) (+()) its just parenthesis...

javier
On 12/15/05, Yonik Seeley <yseeley@gmail.com> wrote:
> Are you using the same Analyzer for both indexing and querying (or the
> same StopFilter at least)?
>
> -Yonik
>
> On 12/15/05, javier muguruza <jmuguruza@gmail.com> wrote:
> >  Hi,
> >
> > Suppose I have a query like this:
> > +attachments:purpose
> >  that returns N hits.
> > If I add another condition
> > +attachments:purpose +attachments:"hello world"
> > I still get some hits, but if the words in the "hello world" phrase
> > happen to be all stop words I get 0 hits.
> >
> > I can fix that by checking at least one of them is not a stop word,
> > but just wanted to know wether thats expected behaviour.
> >
> >
> > Im using lucene1.9rc.
> > thanks
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message