Skip to content

Commit

Permalink
Added a custom analyzer for "content" (ngrams, word delimiter)
Browse files Browse the repository at this point in the history
  • Loading branch information
clintongormley authored and karmi committed Sep 10, 2012
1 parent 85a78a2 commit 66a3f0b
Showing 1 changed file with 24 additions and 8 deletions.
32 changes: 24 additions & 8 deletions config.example.rb
Expand Up @@ -7,17 +7,33 @@ module Hide
:directories => ['guide', 'community', 'tutorials', 'videos'], :directories => ['guide', 'community', 'tutorials', 'videos'],
:index_name => 'elastic-search-website', :index_name => 'elastic-search-website',


:mappings => { :settings => {
:analysis => {
:filter => {
:ngrams => {:type => 'edgeNGram', :max_gram => 30},
:word_delim => {:type => 'word_delimiter', :preserve_original => 1},
},
:analyzer => {
:content => {
:filter => ['standard','lowercase','word_delim','ngrams'],
:type => 'custom',
:tokenizer => 'standard'
}
}
}
},

:mappings => {
:guide => { :guide => {
:properties => { :properties => {
:title => { :type => 'string', :boost => 2.0, :analyzer => 'snowball' }, :title => { :type => 'string', :boost => 2.0, :analyzer => 'content' },
:content => { :type => 'string', :analyzer => 'snowball' }, :content => { :type => 'string', :analyzer => 'content' },
:id => { :type => 'string', :index => 'not_analyzed', :include_in_all => false }, :id => { :type => 'string', :index => 'not_analyzed', :include_in_all => false },
:url => { :type => 'string', :index => 'not_analyzed', :include_in_all => false }, :url => { :type => 'string', :index => 'not_analyzed', :include_in_all => false },
:category => { :type => 'string', :analyzer => 'keyword', :include_in_all => false }, :category => { :type => 'string', :analyzer => 'keyword', :include_in_all => false },

}, },
:_all => { :analyzer => 'snowball' } :_all => { :analyzer => 'content' }
} }
}, },


Expand Down

0 comments on commit 66a3f0b

Please sign in to comment.