Skip to content

Instantly share code, notes, and snippets.

@naoyamakino
Last active December 16, 2015 21:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save naoyamakino/5497556 to your computer and use it in GitHub Desktop.
Save naoyamakino/5497556 to your computer and use it in GitHub Desktop.
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