Elasticsearch8索引和文档的基本操作
- wang
- 2024-06-13
- 工作笔记
- 3浏览
- 0评论
1 索引
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"}
}
}
本站文章除注明转载/出处外,均为本站原创或翻译。若要转载请务必注明出处,尊重他人劳动成果共创和谐网络环境。
转载请注明 : 文章转载自 » 纵马网 » 工作笔记 » Elasticsearch8索引和文档的基本操作