ES-条件查询
caesar_shf
这个作者很懒,什么都没留下…
展开
-
ES-嵌套条件查询
GET /my-index-000001/_search?from=40&size=20{ "query": { "term": { "user.id": "kimchy" } }}my-index-000001 索引名称?from=40&size=20 分页条件 从第40条开始,一页20条数据 "user.id": "kimchy" 匹配user复合对象下面id 的值为 kimchy 的数据 表明user 是一个一级字段,.原创 2021-08-31 21:03:46 · 889 阅读 · 0 评论 -
ES-获取索引字段信息
GET /idx_hippo_index原创 2021-08-29 17:34:20 · 734 阅读 · 0 评论 -
ES-范围+in查询
GET /idx_hippo_sku_statistics_index/sku_statistics_index/_search{ "from" : 0, "size" : 100, "query" : {"bool" : { "must":[ { "range" : { "salePrice" : { "from" : 1.9, "to" : 2.1, "include_lower"..原创 2021-08-29 17:32:56 · 724 阅读 · 0 评论 -
ES-排序
GET /idx_hippo_sku_index/sku_index/_search{ "query": {"term": { "cityId": { "value": 136 }} },"sort": [ { "salePrice": "asc" }]}"sort": [ { "salePrice": "asc" } ]表示需要进行排序操作;salePrice 根据这个字段做升序排序sort 数据结构为数组,所以可以同时又多个排序字段;...原创 2021-08-29 17:29:52 · 272 阅读 · 0 评论 -
ES -范围查询+精确匹配+排序
DSL 语句:GET /idx_sku_statistics_index/sku_index/_search{"from" : 0,"size" : 100,"query" : {"bool" : { "must":[ { "range" : { "salePrice" : { "from" : 1.9, "to" : 2.1, "include_lower": true, .原创 2021-08-29 17:19:08 · 1671 阅读 · 0 评论 -
ES - 查询所有数据
DSL 语句:1、GET /idx_shop_sku_index/_search默认返回10条数据GET /idx_shop_sku_index/sku_index{"query":{"match_all":{}}}idx_shop_sku_index 索引名称sku_index 类型原创 2021-08-29 17:14:41 · 10873 阅读 · 0 评论 -
ES -多条件查询
GET /idx_hippo_sku_statistics_index/sku_statistics_index/_search{"from" : 0, "size" : 100,"query" : {"bool" : { "filter" : [ { "term" : { "cityId" : { "value" : 136 } } }, { "term" : { ...原创 2021-08-29 17:11:31 · 2943 阅读 · 0 评论 -
ES-根据id查询
DSL语句:GET /idx_shop_sku_index/sku_index/1解释说明:idx_shop_sku_index 索引名称 sku_index 类型 1 id值原创 2021-08-29 17:06:17 · 10700 阅读 · 0 评论 -
ES-字段是否存在查询
GET index/type/_search{ "query": { "bool": { "must_not": { "exists": { "field": "字段名" } } } }}index 索引名称type 类型GET index/type/_search{ "query": { "bool": { "must": { "exis..原创 2021-05-15 20:04:24 · 3858 阅读 · 1 评论 -
ES-or并列条件查询
GET /index/type/_search{ "query": { "bool": { "should": [ { "bool": { "must": [ { "term" : { "field1" : { "value" : 110, "b.原创 2021-05-15 20:03:13 · 5897 阅读 · 0 评论