如果可以将其更改为包含已设置的位索引的数组。也就是说
011100会
[ 1 , 2 ,3],然后用一个
terms查询做一个
or或一个
must查询
and
范例:
a) document with "111"put test/test/1{ "bit_position" : [ 1, 2, 3 ]}b) document with 010put test/test/2{ "bit_position": [ 2 ]}c) or-ing with 101post test/_search{ "query": { "terms": {"bit_position": [ 1, 3] } }}


