-
Notifications
You must be signed in to change notification settings - Fork 1k
chore: Add suffix and infix search syntax support in query parser #5091
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/core/search/search.cc
Outdated
@@ -118,19 +118,27 @@ struct ProfileBuilder { | |||
string GetNodeInfo(const AstNode& node) { | |||
struct NodeFormatter { | |||
void operator()(std::string* out, const AstPrefixNode& node) const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can write here: template <TagType T> void operator()(std::string* out, const AstAffixNode<T>& node)
to avoid code duplication
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
EXPECT_EQ(1, Parse("*pre")); | ||
EXPECT_EQ(1, Parse("*pre*")); | ||
EXPECT_EQ(0, Parse("*suffix")); | ||
EXPECT_EQ(0, Parse("*infix")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it infix or suffix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be infix
This PR adds syntax parsing support for suffix (*term) and infix (*term*) search patterns. While the actual search implementation remains placeholder, this PR establishes the full parsing pipeline from lexer/parser through to AST nodes and query execution.
The foundation is now in place for future implementation of the actual search algorithms.
Related issues: