I'm searching for documents that contain two terms "one two" in different fields (e.g. title, content etc.). An example in PyLucene:
query = "one two"
clauses = []
for field in fields:
clauses.append(BooleanClause.Occur.SHOULD)
query = MultiFieldQueryParser.parse(Version.LUCENE_CURRENT, query, fields, clauses, analyzer)
I would like to get all documents that contain the term ("one" or "two") and ("one" and "two") and the documents that contain both should get a higher score. When I use a query like "one and two" or "one two"~n I get only that documents.
Is there a way to boost something like multiple matches?
Thanks.