Elasticsearch常用操作

Elasticsearch指定默认分词器

{
  "settings": {
    "index": {
      "analysis.analyzer.default.type": "zhongwen"
     }
   }
}

Elasticsearch添加字段

put realtime_statistics_teacher_new_v1/_mapping/realtime_statistics_teacher_new

//put index/_mapping/type

{

  "properties": {

       "field1": {

           "type":     "integer"

       },

        "field2": {

           "type":     "integer"

       },

        "field3": {

           "type":     "integer",
           "analyzer": "zhongwen" //指定分词器

       }

   }

}

Elasticsearch验证分词结果

post index/_analyze

{"text":"大水冲了龙王庙","analyzer":"zhongwen"}

Elasticsearch查看集群信息

/_cat/allocation

/_cat/shards

/_cat/shards/{index}

/_cat/master

/_cat/nodes

/_cat/tasks

/_cat/indices

/_cat/indices/{index}

/_cat/segments

/_cat/segments/{index}

/_cat/count

/_cat/count/{index}

/_cat/recovery

/_cat/recovery/{index}

/_cat/health

/_cat/pending_tasks

/_cat/aliases

/_cat/aliases/{alias}

/_cat/thread_pool

/_cat/thread_pool/{thread_pools}

/_cat/plugins

/_cat/fielddata

/_cat/fielddata/{fields}

/_cat/nodeattrs

/_cat/repositories

/_cat/snapshots/{repository}

/_cat/templates
posted @ 2019-10-23 10:41  学仰泳的鱼  阅读(158)  评论(0编辑  收藏  举报