0
votes

According to this page:

http://lucene.apache.org/core/old_versioned_docs/versions/2_9_1/queryparsersyntax.html

you can do searches like

title:"The Right Way" AND text:go

But when i do something like:

title:"The Right Way" OR title:"Home" I get no results even though I know there are pages with the title "Home".

How do I build a Lucene Query to do multiple ORs/ANDs for the same field ?

2
That query looks fine to me. Do you get any results for the simpler query title:Home ?femtoRgon

2 Answers

0
votes

When debugging queries, I always use Luke. Luke lets you see exactly how Lucene interprets your query (as the ANDs and ORs are turned into SHOULDs and MUSTs).

0
votes

If you print out Query queryParser.parse("title:\"The Right Way\" OR title:\"Home\"") by StandardAnalyzer, the result is Query is [title:"the right way" title:home]