es常用设置命令总结

wylc123 1年前 ⋅ 2668 阅读
curl -XPUT "http://localhost:9200/*/_settings" -d "{ """index""" : { """max_result_window""" : 10000000 } }" -H "Content-Type: application/json"    -u elastic:12345678


curl -H "Content-Type: application/json" -u elastic:12345678 -XPUT http://127.0.0.1:9200/qyjs_mix_data_small/_settings -d '{ "index.max_result_window" :"20000000"}'

1. 查看es存在的索引

curl -XGET "http://localhost:9200/_cat/indices" -H "Content-type: application/json"  -u elastic:12345678

2.  删除索引

curl -XDELETE -u elastic:12345678 "http://localhost:9200/sharingdata"

3. 设置最大分页

curl -XPUT "http://localhost:9200/*/_settings" -d "{ """index""" : { """max_result_window""" : 10000000 } }" -H "Content-Type: application/json"    -u elastic:12345678

4. 修改es用户密码

curl -XPOST -H "Content-type: application/json" -u elastic:12345678 "http://127.0.0.1:9200/_xpack/security/user/elastic/_password?pretty" -d "{"""password""": """12345678"""}"

5. text类型字段ES 开启字段内存排序,设置fielddata = true

curl -XPUT "http://localhost:9200/sharingdata/_mapping" -H "Content-type: application/json" -d "{"""properties""": {"""systemnamerely""": {"""type""":"""text""","""fielddata""": true}}}"  -u elastic:12345678

6. el-sql查询语句

POST /_xpack/sql?format=txt
{
  "query":"select * from sharingdata limit 2"
}

全部评论: 0

    我有话说: