Update elasticsearch settings via Tire

亡梦爱人 提交于 2019-12-11 01:11:13

问题


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]

回答1:


Possible, but ugly :)

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

Will get nicer in future versions...



来源:https://stackoverflow.com/questions/12963571/update-elasticsearch-settings-via-tire

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!