Skip to content

Instantly share code, notes, and snippets.

@arjitgupta
Last active December 17, 2015 01:49
Show Gist options
  • Save arjitgupta/5530830 to your computer and use it in GitHub Desktop.
Save arjitgupta/5530830 to your computer and use it in GitHub Desktop.
Analyzer used to approx search and query
{
"index" : {
"analysis" : {
"analyzer" : {
"my_analyzer" : {
"tokenizer" : "standard",
"filter" : ["standard", "lowercase", "my_metaphone","ourEnglishFilter","mynGram"]
},
"simple_analyzer" : {
"tokenizer": "my_pattern_tokenizer",
"filter" : "lowercase"
}
},
"filter" : {
"my_metaphone" : {
"type" : "phonetic",
"encoder" : "metaphone",
"replace" : false
},
"ourEnglishFilter" :{
"type": "kstem"
},
"mynGram" : {
"type" : "nGram",
"min_gram" : 2,
"max_gram" : 8
}
}
}
}
}
{
"query" : {
"bool" : {
"must" : {
"flt_field" : {
"title" : {
"like_text" : "the beautiful book",
"min_similarity" : 0.5
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment