arve0 / feathers-mongodb-fuzzy-search

Add fuzzy $search to mongodb service.find queries
https://www.npmjs.com/package/feathers-mongodb-fuzzy-search
40 stars 10 forks source link

And Search #10

Open Federico8 opened 6 years ago

Federico8 commented 6 years ago

Hello there, what i'm trying to achieve is an AND search. Right now if my query string is " red blu" will find any document in which columns (fields) contains red OR blu. What i want here is a document with both red AND blu. (Mongodb).

claustres commented 6 years ago

I guess that's the default behaviour in mongo db, please try to either:

Mixing one input as a phrase and one as a term might do the job when limited to 2 terms (from the doc More specifically, the search performs a logical AND of the phrase with the individual terms in the search string in https://docs.mongodb.com/manual/reference/operator/query/text/#phrases).