# Search in multiple fields with highlighting

**URL:** <https://discuss.elastic.co/t/search-in-multiple-fields-with-highlighting/204507>\
**Category:** Elasticsearch\
**Created:** [October 21, 2019, 2:55pm UTC](https://discuss.elastic.co/t/search-in-multiple-fields-with-highlighting/204507 "2019-10-21T14:55:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sandeepv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sandeepv/32/59111_2.png) [@sandeepv](https://discuss.elastic.co/u/sandeepv)\
**Post date:** [October 21, 2019, 2:55pm UTC](https://discuss.elastic.co/t/search-in-multiple-fields-with-highlighting/204507/1 "2019-10-21T14:55:33Z")

</div>

Can we search in multipe fields with hightlighs.

```
 GET /index_name/_doc/_search
{
  "_source": false,
  "query": {
    "bool": {
      "should": [
        {
          "match": {
            "call_data.source_id": {
              "query": 123
            }
          }
        },
        {
          "match": {
            "presentation.sequence_id": {
              "query": 2
            }
          }
        }
      ]
    }
  },
  "highlight": {
    "fields": {
      "call_data.source_id": {
        "highlight_query": {
          "match": {
           "call_data.source_id": {
              "query": 123
            }
          }
        }
      },
      "presentation.sequence_id": {
        "highlight_query": {
          "match": {
            "presentation.sequence_id": {
              "query": 2
            }
          }
        }
      }
    }
  }
}

```

And elasticsearch is not highlighting numeric fields.. is there any solution for this.  
Can any one help me on this.?

---

<div class="post-metadata">

**Author:** ![sandeepv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sandeepv/32/59111_2.png) [@sandeepv](https://discuss.elastic.co/u/sandeepv)\
**Post date:** [October 21, 2019, 3:40pm UTC](https://discuss.elastic.co/t/search-in-multiple-fields-with-highlighting/204507/2 "2019-10-21T15:40:08Z")

</div>

I have found a solution

> <https://stackoverflow.com/questions/36715688/indexing-numeric-field-as-both-int-and-string-in-elastic-search>

---

<div class="post-metadata">

**Author:** ![sandeepv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sandeepv/32/59111_2.png) [@sandeepv](https://discuss.elastic.co/u/sandeepv)\
**Post date:** [October 21, 2019, 3:41pm UTC](https://discuss.elastic.co/t/search-in-multiple-fields-with-highlighting/204507/3 "2019-10-21T15:41:33Z")

</div>

But i have another issue with highlights. Is there any way to get other fields along with the highlights..

highlights contains only the matched content.

---

<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 18, 2019, 3:41pm UTC](https://discuss.elastic.co/t/search-in-multiple-fields-with-highlighting/204507/4 "2019-11-18T15:41:36Z")

</div>

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