# Problems using search\_fields and weighting in queries

**URL:** https://discuss.elastic.co/t/problems-using-search-fields-and-weighting-in-queries/325610
**Category:** Elasticsearch
**Created:** [February 15, 2023, 12:35pm UTC](https://discuss.elastic.co/t/problems-using-search-fields-and-weighting-in-queries/325610 "2023-02-15T12:35:34Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![bar8s](https://avatars.discourse-cdn.com/v4/letter/b/ebca7d/32.png) [@bar8s](https://discuss.elastic.co/u/bar8s)
#### Post date: [February 15, 2023, 12:35pm UTC](https://discuss.elastic.co/t/problems-using-search-fields-and-weighting-in-queries/325610/1 "2023-02-15T12:35:34Z")

</div>

I am trying to query an Elasticsearch index with some dynamic weighting on specific fields, but the query parser is rejecting the query

I am basing this on the documentation at [Relevance Tuning Guide, Weights and Boosts | Elastic App Search Documentation [8.6] | Elastic](https://www.elastic.co/guide/en/app-search/current/relevance-tuning-guide.html#relevance-tuning-guide-weights-and-boosts-weights-api)

the simple query is

```auto
{
  "search_fields": {
    "title": {
      "weight": 10
    }
  },
  "query": "gorilla"
}

```

the response is

```auto
"type": "parsing_exception",
                "reason": "Unknown key for a START_OBJECT in [search_fields].",
                "line": 2,
                "col": 20

```

Can anyone offer any advice/guidance as to why this is failing?

---

<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: [March 15, 2023, 12:35pm UTC](https://discuss.elastic.co/t/problems-using-search-fields-and-weighting-in-queries/325610/2 "2023-03-15T12:35:43Z")

</div>

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