java - Using Lucene MultiFieldQueryParser for multiple required fields -


i'm trying use multifieldqueryparser execute following search:

contents:hello world priority:high

i.e., only want see documents returned contain words 'hello' , 'world' , have priority of 'high'. default behaviour multifieldqueryparser appears return either contains contents:hello world or priority:high - can't figure out how change this.

any advice?

multifieldquery used when want search term across multiple fields. looking simple boolean query 2 clauses. query follows should work.

+(+contents:hello +contents:world) +priority:high 

here have 1 boolean query occur.must clauses 1 is, in turn, boolean query 2 clauses , term query.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -