Mongo full text search example

1 · Adrian Matei · Feb. 6, 2021, 11 p.m.
Project: codever - File: personal-bookmarks-search.service.js To perform a text search query on the text index of a collection, you need to use the $text operator. In the example below the results are sorted in order of relevance score, which you must explicitly project to the $meta textScore field and sort on it: let getPersonalBookmarksForSearchedTerms = async function (nonSpecialSearchTerms, page, limit, userId, specialSearchFilters, searchInclude) { let filter = {userId: userId}; i...