BioDrop icon indicating copy to clipboard operation
BioDrop copied to clipboard

[IMPROVEMENT] search api full-text-search

Open badrivlog opened this issue 3 years ago • 18 comments

What would you like to share?

Currently, we have been filter users by JavaScript, that's not efficient for performance. Instead it would be better to perform that logic by MongoDB full-text-search.

Additional information

No response

badrivlog avatar Jul 13 '23 06:07 badrivlog

To reduce notifications, issues are locked until they are https://github.com/EddieHubCommunity/LinkFree/labels/%F0%9F%8F%81%20status%3A%20ready%20for%20dev and to be assigned. You can learn more in our contributing guide https://github.com/EddieHubCommunity/LinkFree/blob/main/CONTRIBUTING.md

github-actions[bot] avatar Jul 13 '23 06:07 github-actions[bot]

The issue has been unlocked and is now ready for dev. If you would like to work on this issue, you can comment to have it assigned to you. You can learn more in our contributing guide https://github.com/EddieHubCommunity/LinkFree/blob/main/CONTRIBUTING.md

github-actions[bot] avatar Jul 14 '23 10:07 github-actions[bot]

This would be a great improvement 👍

eddiejaoude avatar Jul 14 '23 10:07 eddiejaoude

Can I work on it

ArnabChatterjee20k avatar Jul 14 '23 11:07 ArnabChatterjee20k

Can I work on it

@ArnabChatterjee20k I have assigned this to you

SaraJaoude avatar Jul 15 '23 07:07 SaraJaoude

One question I have, full text search wont search for substrings in the slug. So we have to enter the full name to get the results. So will it be be good to implement this?

ArnabChatterjee20k avatar Jul 23 '23 07:07 ArnabChatterjee20k

Can you five an example of what you mean? But if I think I understand, partial search keyword match should return results

eddiejaoude avatar Jul 23 '23 07:07 eddiejaoude

Full text search example My name - ArnabChatterjee20k Now if I search for Arnab or arnab , it will not return results I have to search for ArnabChatterjee20k to get the result

Partial searching or pattern searching will give the result by getting the pattern

But the issue is asking for full text search. So I asked this question

ArnabChatterjee20k avatar Jul 23 '23 07:07 ArnabChatterjee20k

Can you five an example of what you mean? But if I think I understand, partial search keyword match should return results

Yes partial or pattern searching is the ideal one here

ArnabChatterjee20k avatar Jul 23 '23 07:07 ArnabChatterjee20k

Yes fulltext search is designed for partial matches, similar to google search, here from the mongo docs...

Full-text search refers to searching some text inside extensive text data stored electronically and returning results that contain some or all of the words from the query. In contrast, traditional search would return exact matches.

https://www.mongodb.com/basics/full-text-search

eddiejaoude avatar Jul 23 '23 08:07 eddiejaoude

I am currently facing this issue and not getting any solution. I am trying it from the last 2days. Here is solution and the approch and exactly what issue is coming https://stackoverflow.com/questions/76773218/constructing-a-mongodb-query-to-emulate-javascript-filtering-logic-filterevery?noredirect=1#comment135348552_76773218

ArnabChatterjee20k avatar Jul 27 '23 00:07 ArnabChatterjee20k

I am currently facing this issue and not getting any solution. I am trying it from the last 2days. Here is solution and the approch and exactly what issue is coming https://stackoverflow.com/questions/76773218/constructing-a-mongodb-query-to-emulate-javascript-filtering-logic-filterevery?noredirect=1#comment135348552_76773218

I think trying to replicate javascript is not the correct approach, mongo has full text search which we should move to, here is an official example from their docs with features like scoring, fuzzy search etc https://www.mongodb.com/developer/products/atlas/build-movie-search-application/

eddiejaoude avatar Jul 28 '23 12:07 eddiejaoude

Hi everyone, is this issue still being worked on? or is it abandonded? Could I still work this? Thanks!

jackli921 avatar Sep 16 '23 17:09 jackli921

Hi everyone, is this issue still being worked on? or is it abandonded? Could I still work this? Thanks!

@ArnabChatterjee20k ?

SaraJaoude avatar Sep 17 '23 10:09 SaraJaoude

Hi everyone, is this issue still being worked on? or is it abandonded? Could I still work this? Thanks!

@ArnabChatterjee20k ?

No I am going to work on it now only. I told in the discord. Actually I was suffering from some health issues. And my sister met an accident. So I was inactive. I am going to work on it right now

ArnabChatterjee20k avatar Sep 24 '23 16:09 ArnabChatterjee20k

@ArnabChatterjee20k as there has been no activity for some time I have unassigned you from this issue, but we look forward to you contributing when you can on another issue.

SaraJaoude avatar Oct 25 '23 20:10 SaraJaoude

Hi there, can this issue be assigned to me so I can start working on it?

mianakbarjan avatar Oct 26 '23 07:10 mianakbarjan

Sorry @SaraJaoude this is partly my fault, we were undecided about having 2 types of searches because locally we cannot have fulltext search like we do on Monog Atlas - here is the PR https://github.com/EddieHubCommunity/BioDrop/pull/8400

Thank you @ArnabChatterjee20k for your efforts on this issue and pull request.

But I will close this issue for now until we can think of a better way to have our local dev environment the same as production for search

eddiejaoude avatar Oct 26 '23 07:10 eddiejaoude