Thanks, I’ve meditated a week on your answer but can’t seem to grasp how that would work.
Should I use the script property to write some code and do some if statements? Like
“script”: “(doc['author'].value == 100147) ? 2 : 1”
Will this work or is there a more efficient way I’m not seeing?
From: Shay Banon [mailto:email@example.com]
Sent: donderdag 12 mei 2011 11:01
Subject: Re: boosting at query time based on property value
You can use a custom_score query, pass those values as params to the script, and boost based on that. http://www.elasticsearch.org/guide/reference/query-dsl/custom-score-query.html
On Thursday, May 12, 2011 at 1:20 AM, Yannick Smits wrote:
Say I have this kind of records indexed in ES:
"author" : 100147,
"categories" : [3, 5, 7, 11],
"content" : "some text "
Say my user has defined a preference that it is more interested in
certain authors than others, so for instance would like to see books
from author 100147, 100234 and 100602 higher up in the search results
than other books. How can you now apply this boost at query time?
(same goes for categories btw).