ElasticSearch-REST APIS

接口语法

  点击官方API

url -X<VERB> '<PROTOCOL>://<HOST>:<PORT>/<PATH>?<QUERY_STRING>' -d '<BODY>'

 使用示例

  index

PUT /<index>

 You can use the create index API to add a new index to an Elasticsearch cluster. When creating an index, you can specify the following:

  • Settings for the index
  • Mappings for fields in the index
  • Index aliases

   mapping

PUT /<target>/_mapping
Adds new fields to an existing data stream or index. You can also use the put mapping API to change the search settings of existing fields.
For data streams, these changes are applied to all backing indices by default.

   document

PUT /<target>/_doc/<_id> POST /<target>/_doc/ PUT /<target>/_create/<_id> POST /<target>/_create/<_id>

You cannot add new documents to a data stream using the PUT /<target>/_doc/<_id> request format. To specify a document ID, use the PUT /<target>/_create/<_id> format instead.

   search

GET /<target>/_search
GET /_search
POST /<target>/_search
POST /_search

Allows you to execute a search query and get back search hits that match the query. You can provide search queries using the q query string parameter or request body.

 

posted @ 2021-01-17 16:54  鄙人取个名字好难  阅读(91)  评论(0编辑  收藏  举报