当前位置: 首页> 文旅> 美景 > 网站app定制_搭建人才培养平台_电商关键词排名优化怎么做?_中国今日新闻

网站app定制_搭建人才培养平台_电商关键词排名优化怎么做?_中国今日新闻

时间:2025/7/14 6:25:31来源:https://blog.csdn.net/wang0112233/article/details/143502621 浏览次数:0次
网站app定制_搭建人才培养平台_电商关键词排名优化怎么做?_中国今日新闻

1.查询存在该字段的数据

{"query": {"bool": {"must": [{"exists": { "field": "chainCode"}}],"must_not": {"exists": {"field": "isDelete"}}}}
}

备注:存在chainCode 的字段并且不存在isDelete的资源

2.删除id(LxcAjXD2bS1)数据中的chainCode字段

{"query": {"term": {"id.keyword": "LxcAjXD2bS1"}},"script": {"source": "ctx._source.remove('chainCode')"}}

3.查询es 中的条数

/hotel/_count
{"query": {"bool": {"must": [{"term": {"isDelete": {"value":  false}}}]}}
}

4.查询map数据中存在某一个值的数据

code 的结构
"code": {
"108": "42981"
}
{"query":{"bool" : {"must" : [{"term" : {"code.108.keyword" : {"value" : "42921","boost" : 1.0}}}],"adjust_pure_negative" : true,"boost" : 1.0}}
}

5.更新es 数据

{"query": {"term": {"id.keyword": "9988971080"}},"script": {"source": "ctx._source.code = params.code","params": {"code": {"106": "9016003","108": "9989719","103": "H1460832"}}}
}

6.es 只返回某些具体的字段

{"_source": ["hotelName.value", "code.108", "address.value", "phone.value", "district.value", "priceUpdateTime"],"query": {"bool": {"must": [{"exists": {"field": "code.108"}}]}},"sort": [{"priceUpdateTime": {"order": "desc"}}],"size": 1000,  "from": 0
}

7.track_total_hits查询数据的条数

{"query": {"term": {"isDelete": true}},"track_total_hits": true
}

8.通过ID查询具体的某一条数据

{"query": {"term": {"id.keyword": "xZgr7KPlu"}}
}

关键字:网站app定制_搭建人才培养平台_电商关键词排名优化怎么做?_中国今日新闻

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: