To do this, there may be another field and add string as a fieldType for it and index it with the same.
If you want to make an exact match, you can query in the above field.
And if you want to do a partial search .. you can request an earlier field that is indexed by ngram.
OR .. Here is another way you can try.
You determined the current field type using ngram. While indexing, you can define the ngram tokenizer, and for the request you specify the Tokenizer keyword and the lower case filter factory.
When indexing, the text will be tokened, but when the query is executed, it will not.
Abhijit bashetti
source share