# Completion Suggesters stopped working with 2.2.0 upgrade

**URL:** <https://discuss.elastic.co/t/completion-suggesters-stopped-working-with-2-2-0-upgrade/41380>\
**Category:** Elasticsearch\
**Created:** [February 10, 2016, 1:10pm UTC](https://discuss.elastic.co/t/completion-suggesters-stopped-working-with-2-2-0-upgrade/41380 "2016-02-10T13:10:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![datashaman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/datashaman/32/7711_2.png) [@datashaman](https://discuss.elastic.co/u/datashaman)\
**Post date:** [February 10, 2016, 1:10pm UTC](https://discuss.elastic.co/t/completion-suggesters-stopped-working-with-2-2-0-upgrade/41380/1 "2016-02-10T13:10:50Z")

</div>

Hi there,

We've hit an error where a completion suggester which was working before is no longer working. The error thrown is the following:

{"error":{"root\_cause":[{"type":"illegal\_argument\_exception","reason":"Can't write raw bytes whose xcontent-type can't be guessed"}],"type":"illegal\_argument\_exception","reason":"Can't write raw bytes whose xcontent-type can't be guessed"},"status":400}

Mapping for suggest-category is as follows:

```
suggest-category: {
    type: "completion",
    analyzer: "simple",
    payloads: true,
    preserve_separators: true,
    preserve_position_increments: true,
    max_input_length: 50
}

```

Query is as follows:

```
{
    index: "advertisers-current",
    search_type: "count",
    body: {
        suggest: {
            text: "estate",
            suggest-category: {
                completion: {
                    field: "suggest-category",
                    fuzzy: {
                        fuzziness: 0
                    }
                }
            }
        }
    }
}

```

The suggest-category field is an array of values.  
Any _ahem_ suggestions? The error is pretty cryptic. This works flawlessly on 2.1.1.

---

<div class="post-metadata">

**Author:** ![aluminous](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aluminous/32/7852_2.png) [@aluminous](https://discuss.elastic.co/u/aluminous)\
**Post date:** [February 17, 2016, 2:23am UTC](https://discuss.elastic.co/t/completion-suggesters-stopped-working-with-2-2-0-upgrade/41380/2 "2016-02-17T02:23:35Z")

</div>

Hi datashaman,

What type are your payloads?

I'm not sure if you're still having this issue, but in my case I saw this error because I was using String payloads. Checking the docs revealed that payloads are "arbitrary JSON objects", so I guess the fact that this worked pre-2.2.0 was a bug.

Changing the payload to a single-property JSON object resolved the error.

---

<div class="post-metadata">

**Author:** ![datashaman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/datashaman/32/7711_2.png) [@datashaman](https://discuss.elastic.co/u/datashaman)\
**Post date:** [February 17, 2016, 8:20am UTC](https://discuss.elastic.co/t/completion-suggesters-stopped-working-with-2-2-0-upgrade/41380/3 "2016-02-17T08:20:04Z")

</div>

Thanks very much for your help, that solved my problem!

---

<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, 11:15pm UTC](https://discuss.elastic.co/t/completion-suggesters-stopped-working-with-2-2-0-upgrade/41380/4 "2017-07-05T23:15:48Z")

</div>


