How can we implement ngram_anlyzer without affecting the phrase_search


I want to search the ngram analyzed data without being affected the results
of phrase search.

If I used the ngram analyzer, it affects the phrase search results. For
instance, I'm querying for the string "phrase query", it would display the
results for exact match, instead it outputs match for "phrase" and "query".
Here are the settings I've been using, what should be done to get the
desired result.

"settings" : {
"index": {
"analysis" : {
"analyzer" : {
"my_ngram_analyzer" : {
"tokenizer" : ["my_ngram_tokenizer", "whitespace"],
"filter" : "lowercase"
"tokenizer" : {
"my_ngram_tokenizer" : {
"type" : "nGram",
"min_gram" : "3",
"max_gram" : "20",
"token_chars": [ "letter", "digit" ]


You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
For more options, visit