Skip to content
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

search: add nick keyword search #4579

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cartfisk
Copy link

@cartfisk cartfisk commented Jun 1, 2022

  • search messages by author with from:nick
  • add section to Help.vue
  • should be easy to adapt this into global keyword-based search

#4209

- search messages by author with `from:nick`
- add section to Help.vue
- should be easy to adapt this into global keyword-based search

thelounge#4209

if (filters && Object.keys(filters).length) {
if (filters.from) {
select += ' AND json_extract(msg, "$.from.nick") LIKE ?';
Copy link
Member

@xPaw xPaw Jun 4, 2022

Choose a reason for hiding this comment

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

Does this need ESCAPE, or do we expect from: to be exact matches, why use LIKE then?

})
);

store.index(
Copy link
Member

Choose a reason for hiding this comment

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

I would add a few messages from users like thelounge007abc abcthelounge007, abcthelounge007abc to test whether there are partial nick matches.

// - "from:nick" to find messages sent by a given nick
const keywords = ["from"];
const joinedKeywords = keywords.map((kw) => kw + ":").join("|");
const filterExp = RegExp(`((${joinedKeywords})(\\S+))+`, "g");
Copy link
Member

Choose a reason for hiding this comment

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

Does this need \s* or \b? testfrom:xpaw

@brunnre8 brunnre8 added the Status: changes-requested Review happened but some changes need to be made label Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: changes-requested Review happened but some changes need to be made
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants