-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
[FIX] Message search breaking URL and emojis, and missing results [WIP] #18913
Conversation
Alright, I fixed the part about URLs and emojis broken by the Advancements on search results :
See following screenshots for results with I'd like to know if it's a normal behavior ? In my opinion (and not only mine #18770), typing @MartinSchoeler what do you think ? Is this normal, or should I try to fix this ? |
This comment has been minimized.
This comment has been minimized.
@sampaiodiego Sorry to bother you. I got yet another feedback today from a user of our RocketChat instance, complaining about this search behavior (TLDR: some search results won't show up, and it forces people to use regex). I just need to know if this is a wanted behavior, or if I need to investigate on that to complete that PR. Many thanks in advance for your answer ! |
we might need to enhance the documentation to mention that the message search uses MongoDB text search (https://docs.mongodb.com/manual/text-search/) (@faria-techwrite what do you think?) and because of that (I guess specially depending on the language) the results might really not be as the expected. it has a lot of benefits, but I can see it being frustrating some times. also it is worth mention that it supports exact search between quotes, that might help getting some expected results. |
You're right, I didn't know it was using MongoDB text search ! And I can understand that choice and its benefits ! However I'll try to do the same search operations on MongoDB directly, to see if there is any difference |
that really depends.. I think (and that's only my personal opinion) it might be the expected result if you have some tech background (like you may think it uses SQL the mongodb text index isn't working only for exact searches.. it works for plurals or typos for example, if you search for |
I totally understand your opinion, and I think it's kinda an history of habits, even with tech background, as a lot of search engines differ ! Do you think it would be worth mentioning that to the user (for example, just above the "you can search using a regex" text, which is above the search field) ? That behaviour is nice to know, I just tried that with a french word, and it handled well the plural (but not the typo, maybe because it's in french). However, these results will be in the result list but won't be highlighted, but it's kinda "normal" |
I do, not sure how to that though (pinging @faria-techwrite again, maybe she has an idea).
Looks like I was mistaken about the "typo feature", sry about that, but it has few other interesting features. |
I pulled last modifications from I also fixed |
@sampaiodiego I may have done a |
@TBG-FR yes, that's an issue 😬 we can't see the real diff anymore.. can you please clean it up so we can see only the changes you've made? thx |
@sampaiodiego I fixed it, that should be good now 😉 EDIT : Looks like one of my git commands closed the PR... Can you reopen it, or should I try something else ? Sorry for that fail 🤕 |
looks like it closed because there are no more changes 🤔 |
Yeah, I had one commits with the changes, with I force pushed onto my branch to erase all the messed up stuff, but then I did another force push which took the Anyway, I've reopen a separate PR (#20878), so we'll finally be good. |
Proposed changes
It has been reported that when searching for a message, the results were displaying with bugs : URLs where broken, emojis title too, and some results are missing. This PR aims to fix these issues.
Elements resolved:
<mark>
<mark>
mailto:
links are broken by search<mark>
Issue(s)
#18770 => reports that highlighted links, emojis (and mentions ?) are broken, as well as missing results
#18696 => reports that highlighted links are broken
#18456 => report that highlighted links are broken
How to test or reproduce
Go into a channel, and post these messages :
Then search for the word
smile
in that channel. You'll notice that:<mark>
tags)<mark>
tags toosmilenot.com
link isn't part of the resultsScreenshots
See issues for screenshots
Types of changes
Checklist
Changelog
Further comments
Broken links/emojis
I fixed the
<mark>
tag issue by doing threereplace
stepssearchedText
which is inside atitle="..."
orhref="..."
and replacesearchedText
in them by an unique UUIDsearchedText
left and we mark itsearchedText
I did this because I couldn't make a better REGEX, which would exclude
1
and find only2
. If you are able to do it, or if you see a better solution, feel free to comment ! Also, you may wonder "Why an UUID ?" : I used it because I thought that any arbitrary set of characters could end up being part of the initial search, and I think we're safe about that with a V4 UUID.Missing results
Considering the other issue, which we'll call "missing results", I searched in the whole project and found that it uses a Meteor function
messageSearch
. So I suspect Meteor for being responsible of that bug, but we need more investigation to be sure.Related PR
Results highlighting has been implemented in #16166