# Use analyzer in Completion Suggester

**URL:** https://discuss.elastic.co/t/use-analyzer-in-completion-suggester/261161
**Category:** Elasticsearch
**Created:** [January 14, 2021, 6:00pm UTC](https://discuss.elastic.co/t/use-analyzer-in-completion-suggester/261161 "2021-01-14T18:00:29Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![RabBit\_BR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rabbit_br/32/82261_2.png) [@RabBit\_BR](https://discuss.elastic.co/u/RabBit_BR)
#### Post date: [January 14, 2021, 6:00pm UTC](https://discuss.elastic.co/t/use-analyzer-in-completion-suggester/261161/1 "2021-01-14T18:00:29Z")

</div>

I have a question when using the analyzer in Completion Suggestion.  
I understand that CS performs the prefix search. Shouldn't the analyzer allow you to search for another term in the text other than the first?

```auto
{
  "settings": {
      "analysis": {
      "filter": {
        "catalog_auto_complete_filter": {
          "type": "shingle",
          "min_shingle_size": 2,
          "max_shingle_size": 4
        }
      },
      "analyzer": {
        "catalog_auto_complete_analyzer": {
          "type": "custom",
          "tokenizer": "standard",
          "filter": [
            "lowercase",
            "asciifolding",
            "catalog_auto_complete_filter"
          ]
        }
      }
    }
  },
  "mappings": {
    "properties": {
      "suggest": {
        "type": "completion",
        "analyzer": "catalog_auto_complete_analyzer",
        "search_analyzer": "catalog_auto_complete_analyzer"
      },
      "title": {
        "type": "text"
        }
      }
    }
  }
}

```

Data

```auto
{
    "title": "Avatar - Film of James Cameron",
    "suggest":[{ "input" :"Avatar - Film of James Cameron", "weight": 10},{ "input" :"James Cameron", "weight": 8}]
  }

```

Query

```auto
{
  "_source": "title", 
  "suggest": {
    "suggest_movie": {
      "prefix": "Cameron",
      "completion": {
        "field": "suggest",
        "size":5,
        "fuzzy": {
          "fuzziness": 1
        }
      }
    }
  }
}

```

The result is always empty for "Cameron". Shouldn't using the analyzer work?

---

<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: [February 11, 2021, 6:00pm UTC](https://discuss.elastic.co/t/use-analyzer-in-completion-suggester/261161/2 "2021-02-11T18:00:46Z")

</div>

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