问题
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