# Query String Query boosting

**URL:** <https://discuss.elastic.co/t/query-string-query-boosting/151561>\
**Category:** Elasticsearch\
**Created:** [October 9, 2018, 6:51am UTC](https://discuss.elastic.co/t/query-string-query-boosting/151561 "2018-10-09T06:51:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kumpelblase](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kumpelblase/32/35709_2.png) [@kumpelblase](https://discuss.elastic.co/u/kumpelblase)\
**Post date:** [October 9, 2018, 6:51am UTC](https://discuss.elastic.co/t/query-string-query-boosting/151561/1 "2018-10-09T06:51:19Z")

</div>

Hello  
I have 5 different indices on which I would like to do a full text search. The mappings of the indices are all different from another, but they all have a common field on which I can join them on the client side.

To give the question some more context: The 5 indices represent a ticketing system. The main index has all the attributes of a ticket, then there is an other index with the history entries for all tickets, another for the assigned customers, etc.  
These indices all have a common field called "TicketNumber" to identify which history entries are assigned to which tickets.

I already have a query on which I can search all the indices at once, it looks like this:

```
GET _search
{
  "_source": "TicketNumber", 
  "query": {
    "query_string": {
      "default_field": "*",
      "query": "searchtext"
    }
  }
}

```

Now I would like to know if it is possible to boost certain results, like all the results from the main ticket index should have a boosted score.

---

<div class="post-metadata">

**Author:** ![abdon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abdon/32/9195_2.png) [@abdon](https://discuss.elastic.co/u/abdon)\
**Post date:** [October 10, 2018, 1:10pm UTC](https://discuss.elastic.co/t/query-string-query-boosting/151561/2 "2018-10-10T13:10:10Z")

</div>

You can boost results from specific indexes by adding a [`indices_boost` clause](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-index-boost.html) to your search request. For example, your request could look something like this to boost the results from the `my_main_index` index:

```auto
GET _search
{
  "_source": "TicketNumber", 
  "query": {
    "query_string": {
      "default_field": "*",
      "query": "searchtext"
    }
  },
  "indices_boost": [
    {
      "my_main_index": 10
    }
  ]
}

```

---

<div class="post-metadata">

**Author:** ![kumpelblase](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kumpelblase/32/35709_2.png) [@kumpelblase](https://discuss.elastic.co/u/kumpelblase)\
**Post date:** [October 12, 2018, 6:50am UTC](https://discuss.elastic.co/t/query-string-query-boosting/151561/3 "2018-10-12T06:50:38Z")

</div>

Wow thanks, that is just perfectly what I needed.

---

<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:** [November 9, 2018, 6:50am UTC](https://discuss.elastic.co/t/query-string-query-boosting/151561/4 "2018-11-09T06:50:38Z")

</div>

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