您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

Elasticsearch中的位数组用法和过滤

Elasticsearch中的位数组用法和过滤

如果可以将其更改为包含已设置的位索引的数组。也就是说011100[ 1 , 2 ,3 ],然后用一个terms查询一个or一个must查询and

范例:

a)  document with "111"

put test/test/1
{
   "bit_position" : [
        1,
        2,
        3
    ]
}

b) document with 010
put test/test/2
{
   "bit_position": [
      2
   ]
}

c) or-ing with 101

post test/_search
{
    "query": {
        "terms": {
           "bit_position": [
              1,
              3
           ]
        }
    }
}
其他 2022/1/1 18:13:37 有576人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶