# Suggester collate throws error on terms lookup

**URL:** <https://discuss.elastic.co/t/suggester-collate-throws-error-on-terms-lookup/77632>\
**Category:** Elasticsearch\
**Created:** [March 7, 2017, 10:09am UTC](https://discuss.elastic.co/t/suggester-collate-throws-error-on-terms-lookup/77632 "2017-03-07T10:09:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![buinauskas\_evaldas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/buinauskas_evaldas/32/31439_2.png) [@buinauskas\_evaldas](https://discuss.elastic.co/u/buinauskas_evaldas)\
**Post date:** [March 7, 2017, 10:09am UTC](https://discuss.elastic.co/t/suggester-collate-throws-error-on-terms-lookup/77632/1 "2017-03-07T10:09:02Z")

</div>

I'm trying to run following piece of query that's going to fix silly user typos:

```
POST analysis/_search
{
  "suggest": {
    "DidYouMean": {
      "text": "Frnce",
      "phrase": {
        "field": "_all",
        "analyzer": "standard",
        "size": 1,
        "real_word_error_likelihood": 0.9,
        "max_errors": 0.5,
        "gram_size": 1,
        "confidence": 1.5,
        "force_unigrams": true,
        "direct_generator": [
          {
            "field": "_all",
            "suggest_mode": "missing",
            "min_word_length": 3
          },
          {
            "field": "Title.stemmed",
            "suggest_mode": "missing",
            "min_word_length": 3
          }
        ],
        "collate": {
          "query": {
            "inline": {
              "bool": {
                "must": [
                  {
                    "multi_match": {
                      "query": "{{suggestion}}",
                      "fields": [
                        "SavedText",
                        "Title.stemmed",
                        "MetadataText"
                      ],
                      "operator": "and"
                    }
                  },
                  {
                    "terms": {
                      "Permission": {
                        "index": "permission",
                        "type": "user",
                        "id": "4979846",
                        "path": "Permission"
                      }
                    }
                  }
                ]
              }
            }
          }
        }
      }
    }
  }
}

```

However this produces following error:

```
"caused_by": {
  "type": "illegal_argument_exception",
  "reason": "features that prevent cachability are disabled on this context"
}

```

If I remove terms lookup, query works. Any idea how to fix this? It used to work in 1.7 version (the one I'm making upgrade from)

---

<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:** [April 4, 2017, 10:09am UTC](https://discuss.elastic.co/t/suggester-collate-throws-error-on-terms-lookup/77632/2 "2017-04-04T10:09:12Z")

</div>

Closed on April 4, 2017, 10:09am UTC

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