Boosting results by date

Hi all,
I posted this topic one month ago but there were no related replies. I am
interested in boosting my results by more recent date, this
is, modifying they score so as to newer documents have a slightly bigger
score than older ones
(notice that I don't mean sorting by
date
).
I do know that I can't modify the score in runtime, so it becomes quite
difficult.
I have discovered new features in ES so it may be easier to achieve it right
now. Maybe I could use a boosting query to enhance the more recent ones
and to demote the older ones. Is it a good idea?
Any help is appreciated! Thanks!
Tania

Hi Tania,

Doing this at a fine grain level will be harder than doing this roughly.

For instance, you could do this by month by storing a month field (eg.
"201101".."201112", "201001".."201012", "200901".."200912") and boosting
this field at query time on the terms closest to today. For instance, today
I'd boost "201109" the most, "201108" a little less and "201107" a little
less still.

You can do this at a more granular level, but it means passing more query
terms to the search.

Cheers,
Phil

On Mon, Sep 5, 2011 at 8:51 AM, Tania yosoythania@hotmail.com wrote:

Hi all,
I posted this topic one month ago but there were no related replies. I am
interested in boosting my results by more recent date, this
is, modifying they score so as to newer documents have a slightly bigger
score than older ones
(notice that I don't mean sorting by
date
).
I do know that I can't modify the score in runtime, so it becomes quite
difficult.
I have discovered new features in ES so it may be easier to achieve it
right now. Maybe I could use a boosting query to enhance the more recent
ones and to demote the older ones. Is it a good idea?
Any help is appreciated! Thanks!
Tania

Hi,

I'm not sure about the performance, but maybe a custom_score query
could be used with a script that (roughly) divides the _score with the
result of the current day minus the days in the date field?

/Joel

On 5 Sep, 18:50, Phil Whelan phil...@gmail.com wrote:

Hi Tania,

Doing this at a fine grain level will be harder than doing this roughly.

For instance, you could do this by month by storing a month field (eg.
"201101".."201112", "201001".."201012", "200901".."200912") and boosting
this field at query time on the terms closest to today. For instance, today
I'd boost "201109" the most, "201108" a little less and "201107" a little
less still.

You can do this at a more granular level, but it means passing more query
terms to the search.

Cheers,
Phil

On Mon, Sep 5, 2011 at 8:51 AM, Tania yosoytha...@hotmail.com wrote:

Hi all,
I posted this topic one month ago but there were no related replies. I am
interested in boosting my results by more recent date, this
is, modifying they score so as to newer documents have a slightly bigger
score than older ones
(notice that I don't mean sorting by
date
).
I do know that I can't modify the score in runtime, so it becomes quite
difficult.
I have discovered new features in ES so it may be easier to achieve it
right now. Maybe I could use a boosting query to enhance the more recent
ones and to demote the older ones. Is it a good idea?
Any help is appreciated! Thanks!
Tania

Yes, my first intention was to use custom_score but the performance was
extremely poor.
I would check boosting queries according to Phil's answer. Thanks a lot
guys! I would post when I find an appropriate solution.

What was the formula that you used to boost by date in this case?

On Tue, Sep 6, 2011 at 10:18 AM, Tania yosoythania@hotmail.com wrote:

Yes, my first intention was to use custom_score but the performance was
extremely poor.
I would check boosting queries according to Phil's answer. Thanks a lot
guys! I would post when I find an appropriate solution.

Hi Tania, apologies for bumping an old question but I'm trying to achieve exactly
the same thinghttp://stackoverflow.com/questions/12091365/is-it-possible-to-boost-newest-items-using-elasticsearch-foqelasticabundle at
the moment and haven't found any examples of this, which I'd have thought
is a very common requirement. Would you mind sharing what your solution
was, assuming you found one and that you can remember that far back.

Thanks

On Tuesday, 6 September 2011 08:18:22 UTC+1, Tania wrote:

Yes, my first intention was to use custom_score but the performance was
extremely poor.
I would check boosting queries according to Phil's answer. Thanks a lot
guys! I would post when I find an appropriate solution.

--

1 Like

Solution:

On Thursday, 23 August 2012 15:24:49 UTC+1, Rob Masters wrote:

Hi Tania, apologies for bumping an old question but I'm trying to achieve exactly
the same thinghttp://stackoverflow.com/questions/12091365/is-it-possible-to-boost-newest-items-using-elasticsearch-foqelasticabundle at
the moment and haven't found any examples of this, which I'd have thought
is a very common requirement. Would you mind sharing what your solution
was, assuming you found one and that you can remember that far back.

Thanks

On Tuesday, 6 September 2011 08:18:22 UTC+1, Tania wrote:

Yes, my first intention was to use custom_score but the performance was
extremely poor.
I would check boosting queries according to Phil's answer. Thanks a lot
guys! I would post when I find an appropriate solution.

--

1 Like