Skip to content

Instantly share code, notes, and snippets.

@Omega359
Created June 20, 2014 19:11
Show Gist options
  • Save Omega359/ab010aaac82ab050af5e to your computer and use it in GitHub Desktop.
Save Omega359/ab010aaac82ab050af5e to your computer and use it in GitHub Desktop.
{
"analysis" : {
"filter" : {
"name_synonyms" : {
"type" : "synonym",
"synonyms_path" : "analysis/name_synonyms.txt",
"expand": "false"
},
"name_ngrams" : {
"type" : "edgeNGram",
"side" : "front",
"max_gram" : 30,
"min_gram" : 1
},
"name_metaphone" : {
"type" : "vdm_filter",
"encoder" : "nysiis_and_id",
"replace" : "false"
},
"city_synonyms" : {
"type" : "synonym",
"synonyms_path" : "analysis/city_synonyms.txt"
},
"city_ngrams" : {
"type" : "edgeNGram",
"side" : "front",
"max_gram" : 30,
"min_gram" : 1
},
"autocomplete_ngrams" : {
"type" : "edgeNGram",
"side" : "front",
"max_gram" : 30,
"min_gram" : 1
}
},
"analyzer" : {
"name_autocomplete_search_analyzer" : {
"filter" : [
"standard",
"lowercase",
"asciifolding",
"name_synonyms"
],
"type" : "custom",
"tokenizer" : "standard"
},
"name_autocomplete_index_analyzer" : {
"filter" : [
"standard",
"lowercase",
"asciifolding",
"name_synonyms",
"name_ngrams"
],
"type" : "custom",
"tokenizer" : "standard"
},
"standard_analyzer" : {
"type" : "standard"
}
}
}
}
and a snippet of a mapping definition using it:
"first_name__v" : {
"type" : "string",
"store" : true,
"term_vector" : "with_positions_offsets",
"analyzer" : "name_autocomplete_search_analyzer",
"fields" : {
"autocomplete" : {
"type" : "string",
"store" : true,
"term_vector" : "with_positions_offsets",
"index_analyzer" : "name_autocomplete_index_analyzer",
"search_analyzer" : "name_autocomplete_search_analyzer"
},
"plain" : {
"type" : "string",
"store" : true,
"term_vector" : "with_positions_offsets",
"analyzer" : "lowercase_keyword_analyzer"
},
"phonetic" : {
"type" : "string",
"store" : true,
"term_vector" : "with_positions_offsets",
"analyzer" : "name_phonetic_analyzer"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment