# Elasticsearch Postings highlighter Error - cannot highlight

**URL:** <https://discuss.elastic.co/t/elasticsearch-postings-highlighter-error-cannot-highlight/112537>\
**Category:** Elasticsearch\
**Created:** [December 20, 2017, 2:24am UTC](https://discuss.elastic.co/t/elasticsearch-postings-highlighter-error-cannot-highlight/112537 "2017-12-20T02:24:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anggiaj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anggiaj/32/12188_2.png) [@anggiaj](https://discuss.elastic.co/u/anggiaj)\
**Post date:** [December 20, 2017, 2:24am UTC](https://discuss.elastic.co/t/elasticsearch-postings-highlighter-error-cannot-highlight/112537/1 "2017-12-20T02:24:34Z")

</div>

I got the following errors when trying to search with posting highlighter:

```
{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "field 'author_name' was indexed without offsets, cannot highlight"
      }
    ],
    "type": "search_phase_execution_exception",
    "reason": "all shards failed",
    "phase": "query_fetch",
    "grouped": true,
    "failed_shards": [
      {
        "shard": 1,
        "index": "post",
        "node": "abc",
        "reason": {
          "type": "illegal_argument_exception",
          "reason": "field 'author_name' was indexed without offsets, cannot highlight"
        }
      }
    ],
    "caused_by": {
      "type": "illegal_argument_exception",
      "reason": "field 'author_name' was indexed without offsets, cannot highlight"
    }
  },
  "status": 400
}

```

And here's my mapping:

```
{
  "post": {
      "mappings": {
          "page": {
              "_routing": {
                  "required": true
              },
              "properties": {
                  "author_name": {
                      "type": "text",
                      "store": true,
                      "index_options": "offsets",
                      "fields": {
                          "keyword": {
                              "type": "keyword"
                          }
                      },
                      "analyzer": "the_analyzer",
                      "search_analyzer": "the_search_analyzer"
                  },
                  "editor": {
                      "properties": {
                          "author_name": {
                              "type": "keyword"
                          }
                      }
                  }
              }
          },
          "blog_post": {
              "_routing": {
                  "required": true
              },
              "properties": {
                  "author_name": {
                      "type": "text",
                      "store": true,
                      "index_options": "offsets",
                      "fields": {
                          "keyword": {
                              "type": "keyword"
                          }
                      },
                      "analyzer": "the_analyzer",
                      "search_analyzer": "the_search_analyzer"
                  },
                  "editor": {
                      "properties": {
                          "author_name": {
                              "type": "keyword"
                          }
                      }
                  }
              }
          },
          "comments": {
              "_routing": {
                  "required": true
              },
              "_parent": {
                  "type": "blog_post"
              },
              "properties": {
                  "author_name": {
                      "type": "text",
                      "store": true,
                      "index_options": "offsets",
                      "fields": {
                          "keyword": {
                              "type": "keyword"
                          }
                      },
                      "analyzer": "the_analyzer",
                      "search_analyzer": "the_search_analyzer"
                  }
              }
          }
      }
  }
}

```

And my query:

```
GET post/article/_search?routing=cat
{
  "query": {
    "bool": {
      "filter": {
        "term": {
          "category": "cat"
        }
      },
      "must": [
        {
          "query_string": {
            "query": "bill",
            "fields": ["author_name"]
          }
        }]
    }
  },
  "highlight": {
    "fields": {
      "author_name": {}
    }
  }
}

```

- Elasticsearch version: 5.1.1
- Lucence version: 6.3.0

When I did \_update\_by\_query it works for a while, before failing again (after more data added).

I did some Googling, and found this issue on Elasticsearch repo:

[https://github.com/elastic/elasticsearch/issues/8558](https://github.com/elastic/elasticsearch/issues/8558), cmiiw, basically said that I need to have the same mapping for the same field name, on the same index. But I already did that, but I didn't know if my editor object, that has author\_name can cause that issue.

How to fix this error? Thanks

---

<div class="post-metadata">

**Author:** ![s1monw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/s1monw/32/3637_2.png) [@s1monw](https://discuss.elastic.co/u/s1monw)\
**Post date:** [December 20, 2017, 9:14am UTC](https://discuss.elastic.co/t/elasticsearch-postings-highlighter-error-cannot-highlight/112537/2 "2017-12-20T09:14:37Z")

</div>

did you reindex all documents after changing the mappings?

---

<div class="post-metadata">

**Author:** ![anggiaj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anggiaj/32/12188_2.png) [@anggiaj](https://discuss.elastic.co/u/anggiaj)\
**Post date:** [December 21, 2017, 10:10pm UTC](https://discuss.elastic.co/t/elasticsearch-postings-highlighter-error-cannot-highlight/112537/3 "2017-12-21T22:10:19Z")

</div>

Yes, I'm using `_update_by_query`, should I do `_reindex` instead? Do I really need to create a new index? I mean some other fields are working, just the `author_name` that's not working

---

<div class="post-metadata">

**Author:** ![anggiaj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anggiaj/32/12188_2.png) [@anggiaj](https://discuss.elastic.co/u/anggiaj)\
**Post date:** [January 3, 2018, 6:24am UTC](https://discuss.elastic.co/t/elasticsearch-postings-highlighter-error-cannot-highlight/112537/4 "2018-01-03T06:24:57Z")

</div>

Actually, it also happens in other fields too.

PS: I'm using `ngram` tokenizer, and `letter`, `digit`, `punctuation`, `symbol` as `token_chars`, as field analyzer

---

<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:** [January 31, 2018, 6:25am UTC](https://discuss.elastic.co/t/elasticsearch-postings-highlighter-error-cannot-highlight/112537/5 "2018-01-31T06:25:15Z")

</div>

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