|
|
|
@ -18,10 +18,28 @@ class Memo < ActiveRecord::Base
|
|
|
|
|
#elasticsearch kaminari init
|
|
|
|
|
Kaminari::Hooks.init
|
|
|
|
|
Elasticsearch::Model::Response::Response.__send__ :include, Elasticsearch::Model::Response::Pagination::Kaminari
|
|
|
|
|
settings index: { number_of_shards: 5 } do
|
|
|
|
|
settings index: {
|
|
|
|
|
number_of_shards: 5 ,
|
|
|
|
|
analysis: {
|
|
|
|
|
char_filter: {
|
|
|
|
|
and_filter: {
|
|
|
|
|
type: "mapping",
|
|
|
|
|
mappings: [ "&=> and "]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
analyzer: {
|
|
|
|
|
my_analyzer: {
|
|
|
|
|
type: 'custom',
|
|
|
|
|
tokenizer: 'standard',
|
|
|
|
|
filter: ['classic'],
|
|
|
|
|
char_filter: ['html_strip']
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} do
|
|
|
|
|
mappings dynamic: 'false' do
|
|
|
|
|
indexes :subject, analyzer: 'smartcn',index_options: 'offsets'
|
|
|
|
|
indexes :content, analyzer: 'smartcn',index_options: 'offsets'
|
|
|
|
|
indexes :subject, analyzer: 'smartcn',index_options: 'offsets'#, char_filter: 'html_strip'
|
|
|
|
|
indexes :content, analyzer:'my_analyzer',index_options: 'offsets',search_analyzer: 'smartcn'
|
|
|
|
|
indexes :updated_at,index:"not_analyzed" ,type:'date'
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|