Skip to content

Instantly share code, notes, and snippets.

@letsbreelhere
Created June 8, 2012 20:14
Show Gist options
  • Save letsbreelhere/2897931 to your computer and use it in GitHub Desktop.
Save letsbreelhere/2897931 to your computer and use it in GitHub Desktop.
tire ngram analyzer
settings analysis: {
filter: {
ngram_filter: {
type: "nGram",
min_gram: 3,
max_gram: 8
}
},
analyzer: {
ngram_analyzer: {
tokenizer: "lowercase",
filter: ["ngram_filter"],
type: "custom"
}
}
} do
mapping do
[:name, :email, :company].each do |attribute|
indexes attribute, type: 'string', analyzer: 'ngram_analyzer'
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment