Skip to content

Instantly share code, notes, and snippets.

@arjitgupta
Last active December 30, 2015 06:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arjitgupta/7792134 to your computer and use it in GitHub Desktop.
Save arjitgupta/7792134 to your computer and use it in GitHub Desktop.
Elastic search Analyzer
{
"index" : {
"analysis" : {
"analyzer" : {
"my_analyzer" : {
"type": "custom",
"tokenizer" : "keyword",
"filter" : "lowercase"
},
"special_char_remover" : {
"type": "custom",
"tokenizer" : "keyword",
"char_filter" : ["special_char_pattern"]
},
"special_char_and_stop_word_remover" : {
"type": "custom",
"tokenizer" : "keyword",
"filter" : "filter_stop",
"char_filter" : "special_char_pattern"
},
"stop_word_remover" : {
"type": "custom",
"tokenizer" : "keyword",
"filter" : "filter_stop"
}
},
"char_filter" : {
"special_char_pattern":{
"type":"pattern_replace",
"pattern":"^a-zA-Z0-9",
"replacement":""
}
},
"filter":{
"filter_stop":{
"type":"stop",
"enable_position_increments":"false",
"ignore_case":"true",
"stopwords": ["_english_"]
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment