Skip to content

Add configurable stopwords feature#305

Open
yukidukie wants to merge 5 commits into
valeriansaliou:masterfrom
yukidukie:user-defined-stopwords
Open

Add configurable stopwords feature#305
yukidukie wants to merge 5 commits into
valeriansaliou:masterfrom
yukidukie:user-defined-stopwords

Conversation

@yukidukie
Copy link
Copy Markdown

resolve #300

This pr adds a feature that allows users to override the predefined stopwords of Sonic.

The configuration file can include this to configure Sonic's stopwords only to foo and bar.

[channel.search.stopwords]
eng=["foo", "bar"]

I also believe the pr could help #254 and #266 too because you can do this to disable stopwords completely.

[channel.search.stopwords]
eng=[]

@valeriansaliou
Copy link
Copy Markdown
Owner

Thank you for this PR. Would it be possible to use macros in order to do some codegen on this?

@yukidukie
Copy link
Copy Markdown
Author

@valeriansaliou
Thank you for the review. I will try macros.

@yukidukie
Copy link
Copy Markdown
Author

Hi, @valeriansaliou
I added a stopwords codegen macro. If I'm misunderstanding something, please let me know. Thank you!

@valeriansaliou
Copy link
Copy Markdown
Owner

Thank you, will review soon!

@RemiBardon
Copy link
Copy Markdown
Collaborator

Hello @yukidukie and thank you for your contribution.

I know it’s been silent for a while but we are resuming work on Sonic to make substantial improvements. I will try to integrate your PR in the next releases.

Overlooking your code, I think it could be done in a more flexible way without having to hardcode the struct keys (by using a HashMap and a custom deserializer). I say this because I just had to add a new language in a PR (#342) and it’s the kind of situation where we’d have to remember to update the configuration struct. Mistakes will inevitably happen so I’ll try to find a clever way to mitigate this issue.

Would you be okay if I create my own PR or would you like me to modify yours so you keep co-ownership? In any case, I’ll ping you on my PR whenever I create it and propose to add you as a co-author.

@RemiBardon RemiBardon self-assigned this May 14, 2026
@yukidukie
Copy link
Copy Markdown
Author

Hey @RemiBardon

Thank you for the detailed feedback. That makes sense to me.

Feel free to open your own PR if that’s easier, and thank you for offering co-authorship as well!

@github-project-automation github-project-automation Bot moved this to Backlog & Ideas 💡 in Sonic Planning Jun 4, 2026
@RemiBardon RemiBardon moved this from Backlog & Ideas 💡 to Paused / Blocked ⏸️ in Sonic Planning Jun 4, 2026
@RemiBardon RemiBardon moved this from Paused / Blocked ⏸️ to Needs Review 🕵️ in Sonic Planning Jun 4, 2026
@RemiBardon RemiBardon added feature Anything that is related to a new feature feat:search Relates to anything in the Search mode except i18n labels Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat:search Relates to anything in the Search mode except i18n feature Anything that is related to a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

User defined stopwords

3 participants