Slide 12
Slide 12 text
More Elasticsearch Terms!
Mapping
http://localhost:9200/INDEX_NAME/_mapping
Defines fields and data-types within an index/type
tire do
index_name 'topics'
mapping do
indexes :id, :index => :not_analyzed
indexes :created_at, :type => 'date'
indexes :forum_id, :type => 'integer'
indexes :subject, :type => 'string', :analyzer => 'keyword', :boost => 100
indexes :last_post_author, :type => 'string'
indexes :last_post_text, :type => 'string',
:as => Proc.new{ posts.active.any? ? posts.active.last.text : "" }
indexes :last_post_updated_at, :type => 'date'
indexes :ranking, :type => 'integer'
indexes :deleted, :type => 'integer'
indexes :text, :type => 'string', :analyzer => 'keyword',
:as => Proc.new{ posts.active.collect{ |post| post.text }.join(' ') }
end
end