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
Post a Comment