Sorry guys, I initially simplified the criteria. Actually, I use
EDisMaxQueryParser with about dozen of fields configured with
different boost values.
If any of them is matched - it's ok to return such document.

But I also have one (at the moment) field - that I would like to use
only to "boost" resulting score. So, if document is matched only by
value of this field - it should not be returned.

I suppose, boost query of form "bq=field2:foobar^2" should do the
trick. As well as I can use boost function to apply more complex
rules.

2012/10/24 Otis Gospodnetic <otis.gospodne...@gmail.com>:
> Hi,
>
> This is core lucene/solr functionality. +field1:foo field2:foo makes a
> match in field1 required.
>
> Otis
> --
> Performance Monitoring - http://sematext.com/spm
> On Oct 24, 2012 4:39 AM, "Maxim Kuleshov" <maxim.kules...@gmail.com> wrote:
>
>> 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?
>>

Reply via email to