diff --git a/src/search/README.md b/src/search/README.md index 022ec750960..1fb4bbbed1d 100644 --- a/src/search/README.md +++ b/src/search/README.md @@ -32,3 +32,4 @@ Note that when interacting with users, we also refer to KQIR as *Kvrocks Search* - [KQIR: a query engine for Apache Kvrocks that supports both SQL and RediSearch queries](https://kvrocks.apache.org/blog/kqir-query-engine) - [Index encoding format for Kvrocks Search](https://kvrocks.apache.org/community/kvrocks-search-index-encoding) +- [User documentation of Kvrocks Search](https://kvrocks.apache.org/docs/kvrocks-search) diff --git a/src/search/sql_parser.h b/src/search/sql_parser.h index 751b0b47aa2..f90195bd942 100644 --- a/src/search/sql_parser.h +++ b/src/search/sql_parser.h @@ -35,7 +35,8 @@ struct StringOrParam : sor {}; struct NumberOrParam : sor {}; struct HasTag : string<'h', 'a', 's', 't', 'a', 'g'> {}; -struct HasTagExpr : WSPad, StringOrParam>> {}; +struct Tagged : string<'t', 'a', 'g', 'g', 'e', 'd'> {}; +struct HasTagExpr : WSPad>, StringOrParam>> {}; struct NumericAtomExpr : WSPad> {}; struct NumericCompareOp : sor', '='>, one<'=', '<', '>'>> {}; diff --git a/tests/cppunit/sql_parser_test.cc b/tests/cppunit/sql_parser_test.cc index 9173d4c3f3b..e7a4712193f 100644 --- a/tests/cppunit/sql_parser_test.cc +++ b/tests/cppunit/sql_parser_test.cc @@ -117,6 +117,7 @@ TEST(SQLParserTest, Simple) { AssertIR(Parse("select a from b where y > 2"), "select a from b where y > 2"); AssertIR(Parse("select a from b where 3 >= z"), "select a from b where z <= 3"); AssertIR(Parse("select a from b where x hastag \"hi\""), "select a from b where x hastag \"hi\""); + AssertIR(Parse("select a from b where x tagged \"hi\""), "select a from b where x hastag \"hi\""); AssertIR(Parse(R"(select a from b where x hastag "a\nb")"), R"(select a from b where x hastag "a\nb")"); AssertIR(Parse(R"(select a from b where x hastag "")"), R"(select a from b where x hastag "")"); AssertIR(Parse(R"(select a from b where x hastag "hello , hi")"), R"(select a from b where x hastag "hello , hi")");