美文网首页
golang-ElasticSearch相关设置

golang-ElasticSearch相关设置

作者: liziNo1 | 来源:发表于2021-09-29 14:12 被阅读0次

一、查询ES相关信息

curl localhost:9200/_nodes --user elastic:密码

二、设置index为index_log的最大查询数量 

curl -XPUT localhost:9200/index_log/_settings -H 'Content-Type:application/json' -d '{"index.max_result_window" :"100000000"}' --user elastic:密码

//对应golang对应的代码设置TrackTotalHits为true,不然依然无法查询超过10000

searchService = searchService.Query(boolQuery).TrackTotalHits(true)

三、设置所有的最大查询数量 

curl -XPUT localhost:9200/_all/_settings -H 'Content-Type:application/json' -d '{"index.max_result_window" :"100000000"}' --user elastic:密码

//对应golang对应的代码设置TrackTotalHits为true,不然依然无法查询超过10000

searchService = searchService.Query(boolQuery).TrackTotalHits(true)

四、获取单个index为index_log的对应配置信息

curl -XGET localhost:9200/index_log/_settings --user elastic:密码

五、获取全部配置

curl -XGET localhost:9200/_settings/_all --user elastic:密码

相关文章

网友评论

      本文标题:golang-ElasticSearch相关设置

      本文链接:https://www.haomeiwen.com/subject/vvdjnltx.html