lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pawel Rog <ppp.pawel...@gmail.com>
Subject Re: Query parser and default operator
Date Wed, 09 Nov 2016 17:04:26 GMT
Hi Eric,
Thank you for your email.
I understand that Lucene queries are not in boolean logic. My point is only
that I would expect identical Lucene queries build from the same input
string. My intuition says that default operator should not matter in 2
examples I presented in previous email.

--
Paweł Róg

On Wed, Nov 9, 2016 at 4:32 PM, Erick Erickson <erickerickson@gmail.com>
wrote:

> Lucene queries aren't boolean logic. You can simulate boolean logic by
> explicitly parenthesizing, here's an excellent blog on this:
>
> https://lucidworks.com/blog/why-not-and-or-and-not/
>
> Best,
> Erick
>
> On Wed, Nov 9, 2016 at 1:37 AM, Pawel Rog <ppp.pawelrog@gmail.com> wrote:
> > Hello ,
> > I have a query `foo AND bar OR baz`. When I use "AND" as a default
> operator
> > this is the resulting Lucene  query:
> >
> > `+test:foo test:bar test:baz`
> >
> > When I use "OR" this is the resulting query
> >
> > `+test:foo +test:bar test:baz`
> >
> >
> > I expected these two return exactly the same Lucene query because I used
> > operator explicitly. I thought that the default operator is used only
> when
> > operator is not explicitly mentioned in the query. Am I missing something
> > or this is not expected behavior (bug)?
> >
> > --
> > Paweł Róg
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

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