Completion suggester issue

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

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

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

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
                        }
                    ]
                }
            }
        }
    }
}'

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.

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

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