# ES5.0A2: Highlighting and \_all field

**URL:** <https://discuss.elastic.co/t/es5-0a2-highlighting-and--all-field/49742>\
**Category:** Elasticsearch\
**Created:** [May 11, 2016, 9:09am UTC](https://discuss.elastic.co/t/es5-0a2-highlighting-and--all-field/49742 "2016-05-11T09:09:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gquintana](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gquintana/32/48441_2.png) [@gquintana](https://discuss.elastic.co/u/gquintana)\
**Post date:** [May 11, 2016, 9:09am UTC](https://discuss.elastic.co/t/es5-0a2-highlighting-and--all-field/49742/1 "2016-05-11T09:09:16Z")

</div>

The terms "Palais" and "Louvre" are not highlighted in the appellation\_courante field. They are in the commune field.

 ![](https://us1.discourse-cdn.com/elastic/original/2X/c/c31196709bfb2d50d371f9a512c8a79c31077195.png)

After some investigation it seems related to being include to \_all field or not:  
The fields are mapped differently:

```
"monument": {
  "include_in_all":false,
  "properties": {
        "appellation_courante": {
          "type": "text",
          "include_in_all": true,
          "analyzer": "french"
        },
        "commune": {
          "type": "text"
        },

```

Manually executing the query in Elasticsearch

**No highlighting:**

```
POST monument/_search
{
  "query": {
    "match": {
      "_all": "Palais du Louvre"
    }
  },
  "highlight": {"fields": {
    "appellation_courante":{}
  }
  }
}

POST monument/_search
{
  "query": {
    "query_string": {
      "query": "Palais du Louvre"
    }
  },
  "highlight": {"fields": {
    "appellation_courante":{}
  }
  }
}

```

**Highlighting is OK:**

```
POST monument/_search
{
  "query": {
    "match": {
      "appellation_courante": "Palais du Louvre"
    }
  },
  "highlight": {"fields": {
    "appellation_courante":{}
  }
  }
}

POST monument/_search
{
  "query": {
    "query_string": {
      "query": "appellation_courante:Palais du Louvre"
    }
  },
  "highlight": {"fields": {
    "appellation_courante":{}
  }
  }
}
```

---

<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:** [July 5, 2017, 10:52pm UTC](https://discuss.elastic.co/t/es5-0a2-highlighting-and--all-field/49742/2 "2017-07-05T22:52:33Z")

</div>

Closed on July 5, 2017, 10:52pm UTC


