Skip to content

Instantly share code, notes, and snippets.

@polyfractal
Created November 13, 2012 04:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save polyfractal/4063964 to your computer and use it in GitHub Desktop.
Save polyfractal/4063964 to your computer and use it in GitHub Desktop.
ES Mapping
{
"mappings":{
"post":{
"properties":{
"body":{
"fields":{
"body":{
"type":"string",
"analyzer":"analyzer_term"
},
"partial_shingle":{
"search_analyzer":"analyzer_term",
"index_analyzer":"analyzer_partial_shingle",
"type":"string"
}
},
"type":"multi_field"
}
}
}
},
"settings":{
"analysis":{
"filter":{
"filter_partial_shingle":{
"type":"shingle",
"max_shingle_size":5,
"min_shingle_size":2,
"output_unigrams" : "false"
}
},
"analyzer":{
"analyzer_term":{
"filter":[
"lowercase",
"asciifolding"
],
"type":"custom",
"tokenizer":"whitespace"
},
"analyzer_partial_shingle":{
"filter":[
"lowercase",
"asciifolding",
"filter_partial_shingle"
],
"type":"custom",
"tokenizer":"whitespace"
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment