Skip to content

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

Merged
merged 5 commits into from
May 11, 2025

Conversation

vyavdoshenko
Copy link
Contributor

@vyavdoshenko vyavdoshenko commented May 9, 2025

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:

@@ -118,19 +118,27 @@ struct ProfileBuilder {
string GetNodeInfo(const AstNode& node) {
struct NodeFormatter {
void operator()(std::string* out, const AstPrefixNode& node) const {
Copy link
Collaborator

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

Copy link
Contributor Author

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"));
Copy link
Collaborator

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be infix

@vyavdoshenko vyavdoshenko requested a review from romange May 11, 2025 14:26
@vyavdoshenko vyavdoshenko merged commit a51674e into main May 11, 2025
10 checks passed
@vyavdoshenko vyavdoshenko deleted the bobik/basic_infix_suffix_search_support branch May 11, 2025 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants