# Completion suggester issue

**URL:** https://discuss.elastic.co/t/completion-suggester-issue/316657
**Category:** Elasticsearch
**Created:** [October 14, 2022, 3:50pm UTC](https://discuss.elastic.co/t/completion-suggester-issue/316657 "2022-10-14T15:50:23Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Mahesh\_Hegde](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mahesh_hegde/32/112085_2.png) [@Mahesh\_Hegde](https://discuss.elastic.co/u/Mahesh_Hegde)
#### Post date: [October 14, 2022, 3:50pm UTC](https://discuss.elastic.co/t/completion-suggester-issue/316657/1 "2022-10-14T15:50:23Z")

</div>

Issue - completion suggester with custom keyword lowercase analyzer not working as expected. We can reproduce the issue with following steps.

Not able to understand whats causing issue here. However, if we search for "_PRAXIS CONSULTING AND INFORMATION SERVICES PRIVATE_" , it is giving result.

**Create index**

```auto
curl -X PUT "localhost:9200/com.tmp.index?pretty" -H 'Content-Type: application/json' -d'{
  "mappings": {
    "dynamic": "false",
    "properties": {
      "namesuggest": {
        "type": "completion",
        "analyzer": "keyword_lowercase_analyzer",
        "preserve_separators": true,
        "preserve_position_increments": true,
        "max_input_length": 50,
        "contexts": [
          {
            "name": "searchable",
            "type": "CATEGORY"
          }
        ]
      }
    }
  },
  "settings": {
    "index": {
      "mapping": {
        "ignore_malformed": "true"
      },
      "refresh_interval": "5s",
      "analysis": {
        "analyzer": {
          "keyword_lowercase_analyzer": {
            "filter": [
              "lowercase"
            ],
            "type": "custom",
            "tokenizer": "keyword"
          }
        }
      },
      "number_of_replicas": "0",
      "number_of_shards": "1"
    }
  }
}'

```

**Index document**

```auto
curl -X PUT "localhost:9200/com.tmp.index/_doc/123?pretty" -H 'Content-Type: application/json' -d'{
    "namesuggest": {
        "input": [
            "PRAXIS CONSULTING AND INFORMATION SERVICES PRIVATE LIMITED."
        ],
        "contexts": {
            "searchable": [
                "*"
            ]
        }
    }
}
'

```

**Issue - Complete suggest not giving result**

```auto
curl -X GET "localhost:9200/com.tmp.index/_search?pretty" -H 'Content-Type: application/json' -d'{
    "suggest": {
        "legalEntity": {
            "prefix": "PRAXIS CONSULTING AND INFORMATION SERVICES PRIVATE LIMITED.",
            "completion": {
                "field": "namesuggest",
                "size": 10,
                "contexts": {
                    "searchable": [
                        {
                            "context": "*",
                            "boost": 1,
                            "prefix": false
                        }
                    ]
                }
            }
        }
    }
}'

```

---

<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: [October 14, 2022, 6:10pm UTC](https://discuss.elastic.co/t/completion-suggester-issue/316657/2 "2022-10-14T18:10:46Z")

</div>

Hi @Mahesh_Hegde

When the term is longer than 50 characters the suggestion does not work.  
I would open an issue in git, it could be a bug.

---

<div class="post-metadata">

### Author: ![Mahesh\_Hegde](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mahesh_hegde/32/112085_2.png) [@Mahesh\_Hegde](https://discuss.elastic.co/u/Mahesh_Hegde)
#### Post date: [October 17, 2022, 4:50am UTC](https://discuss.elastic.co/t/completion-suggester-issue/316657/3 "2022-10-17T04:50:25Z")

</div>

@RabBit_BR thank you for the details. Is there anywhere in Elasticsearch official documentation mentioning this limitation?

---

<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: [October 17, 2022, 7:50am UTC](https://discuss.elastic.co/t/completion-suggester-issue/316657/4 "2022-10-17T07:50:11Z")

</div>

I didn't find anything in the documentation. I believe opening an issue in git might be better.

---

<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: [November 14, 2022, 7:50am UTC](https://discuss.elastic.co/t/completion-suggester-issue/316657/5 "2022-11-14T07:50:59Z")

</div>

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