"must_not" doesn't work? #4185
-
Code: collection_name = 'test' collection_param = { client.drop_collection(collection_name) c0_list = [1, 2, 3, 4, 5, 6] entities = [ eids = client.insert(collection_name, entities) vecs = [[0., 0.02], [0., 0.35]]
} res = client.search(collection_name, dsl, fields=['c0', 'c1', 'vec']) 结果: 2 4 [0.0, 0.20000000298023224] 3 5 [0.0, 0.30000001192092896] 3 5 [0.0, 0.30000001192092896] 4 6 [0.0, 0.4000000059604645] 2 4 [0.0, 0.20000000298023224] Data of c0 == 1,c0 == 2 and c1 == 6 were not filtered out. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
You can refer to this: {
"bool": {
"must": [
{
"must": [
{
"vector": {
"embedding": {
"metric_type": "L2",
"query": [
[
-0.0882435888051987, ... 0.0524853430688381
]
],
"topk": 100
}
}
}
]
},
{
"must_not": [
{
"term": {
"customer_id": [
-2020600124
]
}
}
]
}
]
}
} |
Beta Was this translation helpful? Give feedback.
You can refer to this: