天天看點

elasticsearch其它一下日常操作

  1. 檢視es表結構或者索引資料(按需使用)

    http://59.1.6.68:19200/kcap_km_docs/type_docs/_search?pretty

    http://12.12.12.125:9200/km/km_docs/_search?pretty

  2. 删除es索引資料

    curl -XDELETE ‘localhost:9200/km?pretty’

    curl -XDELETE ‘localhost:9200/kcap_km_docs?pretty’

    3.檢視es索引庫

    curl -XGET 127.0.0.1:9200/_cat/indices

    curl ‘localhost:9200/_cat/indices?v’

    4.檢視es插件是否安裝成功: curl http://localhost:9200/_cat/plugins

    elasticsearch其它一下日常操作

    5.解決elasticsearch超過10000條無法查詢的問題

    針對當索引:

    curl -XPUT “http://10.4.44.131:9200/km/_settings” -d ‘{“index”:{“max_result_window”:1000000}}’

    全部生效:

    curl -XPUT http://es-ip:9200/_settings -d ‘{ “index” : { “max_result_window” : 100000000}}’

    第二種:在config/elasticsearch.yml檔案中的最後加上index.max_result_window: 100000000,但是這種方法要注意在最前面加上空格

    但是要注意,5.x之後,已經不支援第二種方式了。否則啟動時,會報下列錯誤:

elasticsearch其它一下日常操作

繼續閱讀