Change should_not to must_not in dsl (#5131)

Signed-off-by: fishpenguin <kun.yu@zilliz.com>
This commit is contained in:
yukun 2021-05-07 19:52:24 +08:00 committed by GitHub
parent b1974aede2
commit ecaef24fea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 7 deletions

View File

@ -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) {

View File

@ -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; });
}

View File

@ -292,7 +292,7 @@ vector_anns: <
"bool": {
"must": [
{
"should_not": [{
"must_not": [{
"range": {
"%1%": {
"GT": 3