James,
It's been a little while, but if my memory serves me correctly, the correct
solution is that 'filters' and 'query' must be at the same level in the
custom_filters_score query and you still need a filtering or limiting query
in the query section, e.g.:
custom_filters_score : {
query : {
filtered: {
filter : {
or : [ ] <--- your record matching filters go here
},
query : { } <--- or you can issue a query here
},
score_mode : 'score_multiply',
filters : [ <--- your boost filters go here
{
boost : '1.5',
filter : {
and : [ ]
}
},
...
]
}
The problem in the query I posted in my original message is that I was
trying to get the scoring filters to do the record filtering, which they
don't.
On Thu, Feb 27, 2014 at 12:11 AM, James Martin <[email protected]> wrote:
> Hi Chris,
>
> I'm in the same boat; looking to combine an "or filter" (so 1 or the other
> filter matches) with a custom_filters_score in order to boost results which
> meet a certain criteria.
> Did you have any luck solving this?
>
>
> On Friday, 3 May 2013 15:26:52 UTC+10, Chris wrote:
>>
>> Of course, posting in public results in me (finally) seeing the obvious
>> error:
>>
>> "filter": {
>> "boost": "1.5",
>>
>> Should be:
>>
>> "boost": "1.5",
>> "filter": {
>>
>>
>> However, unlike my previous OR filter, which only returned results which
>> matched one of the filters, now it returns all records (with the right
>> records boosted to the top) - even those that don't match any filters?
>>
>> Is it possible to replicate the behavior of an OR filter query with a
>> customer_filters_score query?
>>
>> --
> You received this message because you are subscribed to a topic in the
> Google Groups "elasticsearch" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/elasticsearch/zXCnWFEW7bE/unsubscribe.
>
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elasticsearch/11ab4355-3dbd-4809-a61d-f8ffc5c28686%40googlegroups.com
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>
--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAKVTPE36Ht96CNXNCcDJa67G9moXGkh76PfWrFg_KdZSOsHokQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.