# Elasticsearch - recency boost error: 'Unknown key for a START\_OBJECT in \[boosts\].'

**URL:** <https://discuss.elastic.co/t/elasticsearch-recency-boost-error-unknown-key-for-a-start-object-in-boosts/283194>\
**Category:** Elasticsearch\
**Created:** [September 2, 2021, 3:57pm UTC](https://discuss.elastic.co/t/elasticsearch-recency-boost-error-unknown-key-for-a-start-object-in-boosts/283194 "2021-09-02T15:57:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![brutal\_logic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brutal_logic/32/94103_2.png) [@brutal\_logic](https://discuss.elastic.co/u/brutal_logic)\
**Post date:** [September 2, 2021, 3:57pm UTC](https://discuss.elastic.co/t/elasticsearch-recency-boost-error-unknown-key-for-a-start-object-in-boosts/283194/1 "2021-09-02T15:57:26Z")

</div>

I'm using the python elasticsearch api to hit a elasticsearch on some data that has the following fields:

```auto
"id", "dateCreated", "title", "text_body"

```

The "dateCreated" is of the form '2021-09-01T23:09:54.79362+00:00'

I'm running a query against elasticsearch as follows:

```auto
    body = {
        "query": {
            "multi_match": {
                "query": <query>,
                "fields": ['title^3', 'body']
            }
        },
        "boosts": {
            "dateCreated": {
                "type": "proximity",
                "function": "linear",
                "center": "now",
                "factor": 8
            }
        },
    }
    res = es.search(index=<index>, body=body)

```

When I run this I get the following error:

```auto
elasticsearch.exceptions.RequestError: RequestError(400, 'parsing_exception', 'Unknown key for a START_OBJECT in [boosts].')

```

I'm guessing it's having some issue with "dateCreated", but I'm not sure what. Any help would be much appreciated. Thanks!

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 3, 2021, 4:18am UTC](https://discuss.elastic.co/t/elasticsearch-recency-boost-error-unknown-key-for-a-start-object-in-boosts/283194/2 "2021-09-03T04:18:35Z")

</div>

Where did you find that use of `boosts` from?

---

<div class="post-metadata">

**Author:** ![brutal\_logic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brutal_logic/32/94103_2.png) [@brutal\_logic](https://discuss.elastic.co/u/brutal_logic)\
**Post date:** [September 3, 2021, 5:20am UTC](https://discuss.elastic.co/t/elasticsearch-recency-boost-error-unknown-key-for-a-start-object-in-boosts/283194/3 "2021-09-03T05:20:26Z")

</div>

This article: [Search API boosts | Elastic App Search Documentation [7.14] | Elastic](https://www.elastic.co/guide/en/app-search/current/boosts.html#boosts-recency-boosts)

Which I'm now realizing is under "app search". Are they different APIs? If so, how do we do boosting in the regaular elasticsearch API?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 3, 2021, 5:37am UTC](https://discuss.elastic.co/t/elasticsearch-recency-boost-error-unknown-key-for-a-start-object-in-boosts/283194/4 "2021-09-03T05:37:43Z")

</div>

Yeah they are a layer on top of the standard Elasticsearch APIs 🙂

You can use this boost` in the query DSL - [Boosting query | Elasticsearch Guide [7.14] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-boosting-query.html)

---

<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:** [October 1, 2021, 5:38am UTC](https://discuss.elastic.co/t/elasticsearch-recency-boost-error-unknown-key-for-a-start-object-in-boosts/283194/5 "2021-10-01T05:38:15Z")

</div>

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