mdgspace / codephile-backend

Back-end for Official Codephile App
https://codephile.mdg.iitr.ac.in/
16 stars 6 forks source link

Replace elasticsearch with MongoDB Atlas search #233

Closed renauga closed 2 years ago

renauga commented 2 years ago

Deleted code and packages related to elasticsearch

renauga commented 2 years ago

@prateek2211 Removed elasticsearch and replaced it with mongoDB Atlas search. For user search to work, the Atlas cloud database to be used should have a text search index named name_index, containing fields fullname, username, and all the fields in the handle object. Also, the fuzziness parameters maxEdits and maxExpansions are set to 2 and 50 (MongoDB default values) for now, but can be changed in the function SearchUser in the file models\user.go. This link can be referred for more info: https://www.mongodb.com/docs/atlas/atlas-search/text/

dev-ritik commented 2 years ago

@prateek2211 @renauga why are we tracking these libraries?

renauga commented 2 years ago

@prateek2211 @renauga why are we tracking these libraries?

Which libraries? Do you mean Elasticsearch and MongoDB?

dev-ritik commented 2 years ago

@prateek2211 @renauga why are we tracking these libraries?

Which libraries? Do you mean Elasticsearch and MongoDB?

Yes, these and others in the vendor folder. Why don't we pull these when we build the server?

prateek2211 commented 2 years ago

@prateek2211 @renauga why are we tracking these libraries?

Which libraries? Do you mean Elasticsearch and MongoDB?

Yes, these and others in the vendor folder. Why don't we pull these when we build the server?

We are using vendor mode for modules, so that exact versions of library are available even if remote repo is not available. It was done because ci was not able to download the required go packages because they were taken down..

refer https://stackoverflow.com/a/61547800/10436060