Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Using elastic search with rails app via Brian Gugliemetti #railsConf

Using elastic search with rails app via Brian Gugliemetti

http://www.elasticsearch.org/

elastic search

  • RESTful search engine built on top of Apache

wanted: autocomplete, replace database full-text search, bring site earch in-house

Terms

node: instance of elasticsearch which belongs to a cluster shard: data partition within a node. ther are primary and replica shards. more shards == daster indexing index: top level data partition. there can be many indecies within a cluster.

gem: Tire

include in AR models include Tire::Model::Search query DSL, index settings and mappings.

include Tire::Model::Callback uses AR callbacks on CUD index updates happen in current thread, imeplement work queue

by default, it indexes all model attributes expcet id create named index equivalent to database table name

mapping: defines field and data types wihin an index/type

Analyzer: determines how ES indexes a given field. composed of a tokenizer and zero or more filters

paging, filters

monitoring: paramedic, bigdesk

ES handles re-balancing automatically when new clusters added

scaling: max cluster size dependent on index settings

briang@spiceworks.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment