Elasticsearch 的交互库 Elastomer-Client

码农软件 · 软件分类 · 常用工具包 · 2019-08-17 20:14:45

软件介绍

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

示例代码:

require 'elastomer/client'
client = Elastomer::Client.new

index = client.index('twitter')
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

本文地址:https://codercto.com/soft/d/12589.html

人工智能时代

人工智能时代

[ 美]杰瑞•卡普兰(Jerry Kaplan) / 李盼 / 浙江人民出版社 / 2016-4-1 / CNY 59.90

 当机器人霸占了你的工作,你该怎么办?机器人犯罪,谁才该负责?人工智能时代,人类价值如何重新定义?  在《人工智能时代》一书中,智能时代领军人、硅谷连续创业者杰瑞·卡普兰指出:智能时代的到来,给人类社会带来了两大灾难性冲击:持续性失业与不断加剧的贫富差距。机器正在很大程度上替代人类的工作,不管你是蓝领还是白领。而针对未来社会将要发生的这些问题,卡普兰在《人工智能时代》一书中从企业、税收和......一起来看看 《人工智能时代》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

随机密码生成器
随机密码生成器

多种字符组合密码