当前位置:首页 > 工作笔记 > 正文内容

Elasticsearch8索引和文档的基本操作


1 索引

微信截图_20240613195416.png

GET /taotu_article/_search

GET /taotu_article/_mapping

DELETE /taotu_article/

PUT /taotu_article/_mapping 

  "properties": {

    "content": {

      "type": "text"

    },

    "fengmian": {

      "type": "text"

    },

    "title": {

      "type": "text"

    }

  }

}


2 文档的新增

PUT /taotu_article/_doc/1

{"title":"ewqeqwe", "fengmian":"qwewqeq", "content":"eqweqweq"}

3 文档的删除

DELETE /taotu_article/_doc/1

4 文档的搜索查询(没有条数限制)

GET /taotu_article/_search

{

  "query": {

    "match": {

      "titlecontent":"a"

    }

  }

}

5 文档的搜索查询(带分页)

GET /taotu_article/_search

{

   "from":0,

    "size":2,

  "query": {

    "match": {"titlecontent":"a"}

  }

}



下一篇:没有了

发表评论

(必填)
(必填)
(选填)

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

最新留言

标签列表