Elasticsearch 的交互库:Elastomer-Client

pdce 9年前

Elastomer-Client 为 ElasticSearch API endpoint 提供一个一对一的映射。API 通过你想要实现的来分解为逻辑部分和访问,每一个逻辑部分代表一个客户端类。

示例代码:

require 'elastomer/client'  client = Elastomer::Client.new     index = client.index('推ter')  index.create(   :settings => { 'index.number_of_shards' => 3 },   :mappings => {   :tweet => {   :_source => { :enabled => true },   :_all    => { :enabled => false },   :properties => {   :author => {    :type => 'string',   :index => 'not_analyzed' },   :tweet  => { :type => 'string', :analyze => 'standard' }        }      }    }  )     index.exists?     index.exists? :type => 'tweet'index.delete

项目主页:http://www.open-open.com/lib/view/home/1434031710176