First, documents are not matched "by field", but "by field value".
So, make sure q.op=OR, mm=0%, and query:
+field1:x field2:x^20
This means that "x" MUST be present in field1 of each document, but IF "x"
happens to be present in field2 of the same document the score will be
boosted (by however much you want.) But "x" is NOT required to be present in
field2 of a document.
You could also specify field2 separately in a boost query:
q=field1:x&bq=field2:x^20
-- Jack Krupansky
-----Original Message-----
From: Maxim Kuleshov
Sent: Wednesday, October 24, 2012 4:38 AM
To: solr-user@lucene.apache.org
Subject: Search field affecting relevance
Hi,
For example, we have documents with two fields - field1 and field2.
Both fields are indexed and both are used in search.
Is there way to return only documents that are matched by field1, but
taking in account that if field2 is matched - relevance should be
higher? In other words, if document "A" is mathced by field1 and
field2 it's relevance should be higher than document "B" matched only
by field1 and document "C" where only field2 is matched should not be
returned at all?
Could you please help with outlining the general approach how to
achieve this? Either it's core lucene feature, or solr post processing
logic or something else?