通过轮胎更新弹性搜索设置 [英] Update elasticsearch settings via Tire

查看:139
本文介绍了通过轮胎更新弹性搜索设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以使用轮胎更新弹性搜索设置吗?我有这个curl命令我想自动运行。

Is it possible to use Tire to update elasticsearch settings? I have this curl command I'd like to run automatically.

`curl -XPUT localhost:9200/tweets/_settings -d '{
      "index" : {
          "refresh_interval" : "-1"
      }
  }'`

该值可通过轮胎使用,但不知道如何应用。

The value is available via tire but I'm not sure how to apply it.

Tweet.tire.settings[:refresh_interval]


推荐答案

Tire::Configuration.client.put([Tire::Configuration.url, Tweet.index.name].join('/'),
                               index: { refresh_interval: '-1' })

将来版本会更好...

Will get nicer in future versions...

这篇关于通过轮胎更新弹性搜索设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆