Skip to content

Instantly share code, notes, and snippets.

@matthuhiggins
Last active August 29, 2015 14:00
Show Gist options
  • Save matthuhiggins/52e51aa6bec4798b1d79 to your computer and use it in GitHub Desktop.
Save matthuhiggins/52e51aa6bec4798b1d79 to your computer and use it in GitHub Desktop.
PROPER_NOUN_INDEX = {
"analysis" => {
"char_filter" => {
"proper_noun_char_filter" => {
"type" => "mapping",
"mappings" => ["'\''=>", "&=>_", "-=>_"]
}
},
"analyzer" => {
"proper_noun" => {
"type" => "custom",
"tokenizer" => "standard",
"filter" => ["standard", "lowercase", "snowball"],
"char_filter" => ["proper_noun_char_filter"]
}
}
}
}
PHONE_INDEX = {
"analysis" => {
"filter" => {
"phone_filter" => {
"type" => "word_delimiter",
"generate_number_parts" => false,
"catenate_numbers" => true
}
},
"analyzer" => {
"phone" => {
"type" => "custom",
"tokenizer" => "keyword",
"filter" => ["phone_filter"]
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment