mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-11-30 10:59:32 +08:00
Change should_not to must_not in dsl (#5131)
Signed-off-by: fishpenguin <kun.yu@zilliz.com>
This commit is contained in:
parent
b1974aede2
commit
ecaef24fea
@ -70,9 +70,9 @@ class Parser {
|
||||
ParseShouldNode(const Json& body);
|
||||
|
||||
ExprPtr
|
||||
ParseShouldNotNode(const Json& body);
|
||||
ParseMustNotNode(const Json& body);
|
||||
|
||||
// parse the value of "should"/"must"/"should_not" entry
|
||||
// parse the value of "should"/"must"/"must_not" entry
|
||||
std::vector<ExprPtr>
|
||||
ParseItemList(const Json& body);
|
||||
|
||||
@ -369,8 +369,8 @@ Parser::ParseAnyNode(const Json& out_body) {
|
||||
return ParseMustNode(body);
|
||||
} else if (key == "should") {
|
||||
return ParseShouldNode(body);
|
||||
} else if (key == "should_not") {
|
||||
return ParseShouldNotNode(body);
|
||||
} else if (key == "must_not") {
|
||||
return ParseMustNotNode(body);
|
||||
} else if (key == "range") {
|
||||
return ParseRangeNode(body);
|
||||
} else if (key == "term") {
|
||||
@ -448,7 +448,7 @@ Parser::ParseShouldNode(const Json& body) {
|
||||
}
|
||||
|
||||
ExprPtr
|
||||
Parser::ParseShouldNotNode(const Json& body) {
|
||||
Parser::ParseMustNotNode(const Json& body) {
|
||||
auto item_list = ParseItemList(body);
|
||||
Assert(item_list.size() >= 1);
|
||||
auto merger = [](ExprPtr left, ExprPtr right) {
|
||||
|
@ -472,7 +472,7 @@ TEST(Expr, TestSimpleDsl) {
|
||||
{
|
||||
Json dsl;
|
||||
Json sub_dsl;
|
||||
sub_dsl["should_not"] = Json::array({get_item(0), get_item(1), get_item(2, 0), get_item(3)});
|
||||
sub_dsl["must_not"] = Json::array({get_item(0), get_item(1), get_item(2, 0), get_item(3)});
|
||||
dsl["must"] = Json::array({sub_dsl, vec_dsl});
|
||||
testcases.emplace_back(dsl, [](int x) { return (x & 0b1111) != 0b1011; });
|
||||
}
|
||||
|
@ -292,7 +292,7 @@ vector_anns: <
|
||||
"bool": {
|
||||
"must": [
|
||||
{
|
||||
"should_not": [{
|
||||
"must_not": [{
|
||||
"range": {
|
||||
"%1%": {
|
||||
"GT": 3
|
||||
|
Loading…
Reference in New Issue
Block a user