1、往es中插入一条记录
PUT /product_index/product/3
{"product_name" : "方太油烟机",
"product_desc" : "一说到星空,就有太多美好的记忆,美丽的浩瀚宇宙,有太多说不清的神秘之处,星空太美丽,太绚烂!",
"price" : 36.00
}
2、单条件查询
GET /product_index/_search{
"query": {
"match": {
"product_name": "toothbrush"
}
}
}
3、多条件查询
GET /product_index/_search
{
"query": {
"bool": {
"must": [
{
"match": {
"product_name": "toothbrush"
}
},
{
"match": {
"product_name": "update5"
}
}
]
}
}
}
本文介绍了如何使用Elasticsearch进行数据操作,包括插入记录、单条件查询及多条件查询等基本功能。通过具体示例展示了JSON格式的数据结构及其查询方式。
9191

被折叠的 条评论
为什么被折叠?



