Skip to content

Instantly share code, notes, and snippets.

@Veraticus
Created January 21, 2013 23:32
Show Gist options
  • Save Veraticus/4590561 to your computer and use it in GitHub Desktop.
Save Veraticus/4590561 to your computer and use it in GitHub Desktop.
analysis:
filter:
ngrams:
side: front
max_gram: 10
min_gram: 1
type: edgeNGram
analyzer:
full:
tokenizer: standard
filter: ["standard", "lowercase", "asciifolding", "trim"]
type: custom
partial:
tokenizer: standard
filter: ["standard", "lowercase", "asciifolding", "ngrams", "trim"]
type: custom
settings ElasticSearchAnalysis do
mapping do
indexes :name, type: 'multi_field', fields: {
name: {type: 'string', analyzer: 'full', boost: 3},
partial: {type: 'string', search_analyzer: 'full', index_analyzer: 'partial'}
}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment