# Functional boost on a date field

**URL:** <https://discuss.elastic.co/t/functional-boost-on-a-date-field/257085>\
**Category:** Elastic Search\
**Tags:** elastic-app-search\
**Created:** [November 30, 2020, 2:48pm UTC](https://discuss.elastic.co/t/functional-boost-on-a-date-field/257085 "2020-11-30T14:48:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Damien\_Alexandre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/damien_alexandre/32/21566_2.png) [@Damien\_Alexandre](https://discuss.elastic.co/u/Damien_Alexandre)\
**Post date:** [November 30, 2020, 2:48pm UTC](https://discuss.elastic.co/t/functional-boost-on-a-date-field/257085/1 "2020-11-30T14:48:30Z")

</div>

Hi!

I'm trying App Search and I was wondering if there is a workaround to boost documents by "freshness" (the closer the date, the better the score).

I see here [Relevance Tuning Guide, Weights and Boosts | Elastic App Search Documentation [7.10] | Elastic](https://www.elastic.co/guide/en/app-search/7.10/relevance-tuning-guide.html#relevance-tuning-guide-weights-and-boosts-boosts) that:

- **Functional Boost** : Applies only to **number** fields.
- **Proximity Boost** : Applies to **number** and **geolocation** fields.

Maybe if I store my date as a number I will be able to work this out, but as Elasticsearch provide a nice way of doing what I want:

> **[Function score query | Elasticsearch Guide \[8.4\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html#function-decay)**

The decay can be applied on geo\_point and date.

Is there any way to boost by Freshness via App Search?

Thanks!

---

<div class="post-metadata">

**Author:** ![Rich\_Kuzsma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rich_kuzsma/32/66159_2.png) [@Rich\_Kuzsma](https://discuss.elastic.co/u/Rich_Kuzsma)\
**Post date:** [November 30, 2020, 7:25pm UTC](https://discuss.elastic.co/t/functional-boost-on-a-date-field/257085/2 "2020-11-30T19:25:27Z")

</div>

Hi Damien,

What you're looking to do is not possible today in App Search. Functional and proximity boosts in App Search do not apply to date fields, unfortunately. This capability is supported in Elasticsearch itself, but not in App Search.

---

<div class="post-metadata">

**Author:** ![Damien\_Alexandre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/damien_alexandre/32/21566_2.png) [@Damien\_Alexandre](https://discuss.elastic.co/u/Damien_Alexandre)\
**Post date:** [December 1, 2020, 9:02am UTC](https://discuss.elastic.co/t/functional-boost-on-a-date-field/257085/3 "2020-12-01T09:02:17Z")

</div>

Yeah that's what I saw.

The only way for me to do that then will be to add a "distance" field on my document and boost the one with smallest value. The downside of this solution is that I will need to update my field content every hour/days.

---

<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:** [December 29, 2020, 9:02am UTC](https://discuss.elastic.co/t/functional-boost-on-a-date-field/257085/4 "2020-12-29T09:02:21Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
