0
votes

I am newest in Lucene.
I'm using Lucene.NET version 2.9.4.

What is the difference between these queries?

the first is:

title:hello AND tags:word

the second is:

+title:hello +tags:word

I testing a software, and I note that the first returns 3 records, and the second returns many records.
I observe that the first returns records where title and tags fields are fuel, but the second returns records where title and tags can be empty.
Is it the difference?

2

2 Answers

1
votes

There is no difference between the two. clause1 AND clause2 is effectively shorthand for +clause1 +clause2

Similarly: clause1 clause2 = clause1 OR clause2

Note, there is really no equivalent for +clause1 clause2 using the boolean operators.

0
votes

Are you sending the query over the Internet, if you are and not urlencoding the request correctly it could be misinterting the '+' as an encoded space and therefore lucene just runs the second query as if the +'s not there which would just OR the two parts and give the results you get.

title:hello tags:word