# Recency

**URL:** <https://discuss.elastic.co/t/recency/2919>\
**Category:** Elasticsearch\
**Created:** [April 18, 2010, 1:50pm UTC](https://discuss.elastic.co/t/recency/2919 "2010-04-18T13:50:44Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [April 18, 2010, 1:50pm UTC](https://discuss.elastic.co/t/recency/2919/1 "2010-04-18T13:50:44Z")

</div>

Hiya all

How can I factor recency into the relevance score? ie add a boost factor  
to docs that have been created more recently.

ta

clint

--  
Web Announcements Limited is a company registered in England and Wales,  
with company number 05608868, with registered address at 10 Arvon Road,  
London, N5 1PR.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [April 19, 2010, 8:16am UTC](https://discuss.elastic.co/t/recency/2919/2 "2010-04-19T08:16:39Z")

</div>

Thats a bit tricky. The best way to provide something like that is by  
elasticsearch providing you with an option to control the boosting based on  
external functions/field values. I plan to add this support to  
elasticsearch.

cheers,  
shay.banon

On Sun, Apr 18, 2010 at 4:50 PM, Clinton Gormley [clinton@iannounce.co.uk](mailto:clinton@iannounce.co.uk)wrote:

> Hiya all
> 
> How can I factor recency into the relevance score? ie add a boost factor  
> to docs that have been created more recently.
> 
> ta
> 
> clint
> 
> --  
> Web Announcements Limited is a company registered in England and Wales,  
> with company number 05608868, with registered address at 10 Arvon Road,  
> London, N5 1PR.

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [April 19, 2010, 8:52am UTC](https://discuss.elastic.co/t/recency/2919/3 "2010-04-19T08:52:01Z")

</div>

On Mon, 2010-04-19 at 11:16 +0300, Shay Banon wrote:

> Thats a bit tricky. The best way to provide something like that is by  
> elasticsearch providing you with an option to control the boosting  
> based on external functions/field values. I plan to add this support  
> to elasticsearch.

The problem with using external functions (if I understand it correctly)  
is that it makes it tricky for us non-java types to use them.

I found this solution on the Solr site:  
[http://wiki.apache.org/solr/FunctionQuery](http://wiki.apache.org/solr/FunctionQuery)

clint

> cheers,  
> shay.banon
> 
> On Sun, Apr 18, 2010 at 4:50 PM, Clinton Gormley  
> [clinton@iannounce.co.uk](mailto:clinton@iannounce.co.uk) wrote:  
> Hiya all
> 
> ```
> How can I factor recency into the relevance score? ie add a
> boost factor
> to docs that have been created more recently.
>     
> ta
>     
> clint
>     
> --
> Web Announcements Limited is a company registered in England
> and Wales,
> with company number 05608868, with registered address at 10
> Arvon Road,
> London, N5 1PR.
> 
> ```

--  
Web Announcements Limited is a company registered in England and Wales,  
with company number 05608868, with registered address at 10 Arvon Road,  
London, N5 1PR.

---

<div class="post-metadata">

**Author:** ![Lukas\_Vlcek1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas_vlcek1/32/819_2.png) [@Lukas\_Vlcek1](https://discuss.elastic.co/u/Lukas_Vlcek1)\
**Post date:** [April 19, 2010, 9:00am UTC](https://discuss.elastic.co/t/recency/2919/4 "2010-04-19T09:00:28Z")

</div>

On Mon, Apr 19, 2010 at 10:52 AM, Clinton Gormley  
[clinton@iannounce.co.uk](mailto:clinton@iannounce.co.uk)wrote:

> On Mon, 2010-04-19 at 11:16 +0300, Shay Banon wrote:
> 
> > Thats a bit tricky. The best way to provide something like that is by  
> > elasticsearch providing you with an option to control the boosting  
> > based on external functions/field values. I plan to add this support  
> > to elasticsearch.
> 
> The problem with using external functions (if I understand it correctly)  
> is that it makes it tricky for us non-java types to use them.

Why? You just list the function name in request parameter.

> I found this solution on the Solr site:  
> [http://wiki.apache.org/solr/FunctionQuery](http://wiki.apache.org/solr/FunctionQuery)
> 
> clint
> 
> > cheers,  
> > shay.banon
> > 
> > On Sun, Apr 18, 2010 at 4:50 PM, Clinton Gormley  
> > [clinton@iannounce.co.uk](mailto:clinton@iannounce.co.uk) wrote:  
> > Hiya all
> > 
> > ```
> > How can I factor recency into the relevance score? ie add a
> > boost factor
> > to docs that have been created more recently.
> > 
> > ta
> > 
> > clint
> > 
> > --
> > Web Announcements Limited is a company registered in England
> > and Wales,
> > with company number 05608868, with registered address at 10
> > Arvon Road,
> > London, N5 1PR.
> > 
> > ```
> 
> --  
> Web Announcements Limited is a company registered in England and Wales,  
> with company number 05608868, with registered address at 10 Arvon Road,  
> London, N5 1PR.

---

<div class="post-metadata">

**Author:** ![timrobertson100](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timrobertson100/32/2467_2.png) [@timrobertson100](https://discuss.elastic.co/u/timrobertson100)\
**Post date:** [April 19, 2010, 9:03am UTC](https://discuss.elastic.co/t/recency/2919/5 "2010-04-19T09:03:54Z")

</div>

I think he means if he has to write the function himself.  
A recency one could be quite easy to implement as a standard function  
and probably would get a lot of use. The inverse would also make good  
sense to me.

On Mon, Apr 19, 2010 at 11:00 AM, Lukáš Vlček [lukas.vlcek@gmail.com](mailto:lukas.vlcek@gmail.com) wrote:

> On Mon, Apr 19, 2010 at 10:52 AM, Clinton Gormley [clinton@iannounce.co.uk](mailto:clinton@iannounce.co.uk)  
> wrote:
> 
> > On Mon, 2010-04-19 at 11:16 +0300, Shay Banon wrote:
> > 
> > > Thats a bit tricky. The best way to provide something like that is by  
> > > elasticsearch providing you with an option to control the boosting  
> > > based on external functions/field values. I plan to add this support  
> > > to elasticsearch.
> > 
> > The problem with using external functions (if I understand it correctly)  
> > is that it makes it tricky for us non-java types to use them.
> 
> Why? You just list the function name in request parameter.
> 
> > I found this solution on the Solr site:  
> > [http://wiki.apache.org/solr/FunctionQuery](http://wiki.apache.org/solr/FunctionQuery)
> > 
> > clint
> > 
> > > cheers,  
> > > shay.banon
> > > 
> > > On Sun, Apr 18, 2010 at 4:50 PM, Clinton Gormley  
> > > [clinton@iannounce.co.uk](mailto:clinton@iannounce.co.uk) wrote:  
> > > Hiya all
> > > 
> > > ```
> > > How can I factor recency into the relevance score? ie add a
> > > boost factor
> > > to docs that have been created more recently.
> > > 
> > > ta
> > > 
> > > clint
> > > 
> > > --
> > > Web Announcements Limited is a company registered in England
> > > and Wales,
> > > with company number 05608868, with registered address at 10
> > > Arvon Road,
> > > London, N5 1PR.
> > > 
> > > ```
> > 
> > --  
> > Web Announcements Limited is a company registered in England and Wales,  
> > with company number 05608868, with registered address at 10 Arvon Road,  
> > London, N5 1PR.

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [April 19, 2010, 9:05am UTC](https://discuss.elastic.co/t/recency/2919/6 "2010-04-19T09:05:16Z")

</div>

> ```
> The problem with using external functions (if I understand it
> correctly)
> is that it makes it tricky for us non-java types to use them.
> 
> ```
> 
> Why? You just list the function name in request parameter.

I was taking 'external functions' to mean a custom function which I need  
to write in Java.

> ```
> I found this solution on the Solr site:
> http://wiki.apache.org/solr/FunctionQuery
> 
> ```

while here they have a list of predefined functions, and a syntax to  
string them together, which makes sense to me.

It may be that, by "external functions" Shay meant the same thing as the  
Solr example, in which case, I'll shut up 🙂

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [April 19, 2010, 9:36am UTC](https://discuss.elastic.co/t/recency/2919/7 "2010-04-19T09:36:42Z")

</div>

Actually, I am thinking of a nicer way to do it then just a set of  
predefined functions. Writing the functions in an expression lang (like  
mvel, which is fast, and has a pretty nice syntax).

cheers,  
shay.banon

On Mon, Apr 19, 2010 at 12:05 PM, Clinton Gormley  
[clinton@iannounce.co.uk](mailto:clinton@iannounce.co.uk)wrote:

> > ```
> > The problem with using external functions (if I understand it
> > correctly)
> > is that it makes it tricky for us non-java types to use them.
> > 
> > ```
> > 
> > Why? You just list the function name in request parameter.
> 
> I was taking 'external functions' to mean a custom function which I need  
> to write in Java.
> 
> > ```
> > I found this solution on the Solr site:
> > http://wiki.apache.org/solr/FunctionQuery
> > 
> > ```
> 
> while here they have a list of predefined functions, and a syntax to  
> string them together, which makes sense to me.
> 
> It may be that, by "external functions" Shay meant the same thing as the  
> Solr example, in which case, I'll shut up 🙂

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [April 19, 2010, 9:44am UTC](https://discuss.elastic.co/t/recency/2919/8 "2010-04-19T09:44:34Z")

</div>

On Mon, 2010-04-19 at 12:36 +0300, Shay Banon wrote:

> Actually, I am thinking of a nicer way to do it then just a set of  
> predefined functions. Writing the functions in an expression lang  
> (like mvel, which is fast, and has a pretty nice syntax).

While it'd be great to support custom functions, it does mean that there  
is another DSL that we have to learn to make use of them.

Having a library of commonly used functions would be very useful.

clint

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [April 19, 2010, 9:45am UTC](https://discuss.elastic.co/t/recency/2919/9 "2010-04-19T09:45:15Z")

</div>

Sure, there will be a built in library as well.

On Mon, Apr 19, 2010 at 12:44 PM, Clinton Gormley  
[clinton@iannounce.co.uk](mailto:clinton@iannounce.co.uk)wrote:

> On Mon, 2010-04-19 at 12:36 +0300, Shay Banon wrote:
> 
> > Actually, I am thinking of a nicer way to do it then just a set of  
> > predefined functions. Writing the functions in an expression lang  
> > (like mvel, which is fast, and has a pretty nice syntax).
> 
> While it'd be great to support custom functions, it does mean that there  
> is another DSL that we have to learn to make use of them.
> 
> Having a library of commonly used functions would be very useful.
> 
> clint

---

<div class="post-metadata">

**Author:** ![Lukas\_Vlcek1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas_vlcek1/32/819_2.png) [@Lukas\_Vlcek1](https://discuss.elastic.co/u/Lukas_Vlcek1)\
**Post date:** [April 19, 2010, 9:57am UTC](https://discuss.elastic.co/t/recency/2919/10 "2010-04-19T09:57:49Z")

</div>

And how about to allow custom functions in Java as plugins too, the same way  
attachments plugin is done. Then anybody should be able to implement  
function in Java and provide jar for.  
Lukas

On Mon, Apr 19, 2010 at 11:45 AM, Shay Banon  
[shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:

> Sure, there will be a built in library as well.
> 
> On Mon, Apr 19, 2010 at 12:44 PM, Clinton Gormley \<[clinton@iannounce.co.uk](mailto:clinton@iannounce.co.uk)
> 
> > wrote:
> 
> > On Mon, 2010-04-19 at 12:36 +0300, Shay Banon wrote:
> > 
> > > Actually, I am thinking of a nicer way to do it then just a set of  
> > > predefined functions. Writing the functions in an expression lang  
> > > (like mvel, which is fast, and has a pretty nice syntax).
> > 
> > While it'd be great to support custom functions, it does mean that there  
> > is another DSL that we have to learn to make use of them.
> > 
> > Having a library of commonly used functions would be very useful.
> > 
> > clint

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 4:24am UTC](https://discuss.elastic.co/t/recency/2919/11 "2017-07-06T04:24:30Z")

</div>


