feathers-mongodb-fuzzy-search
feathers-mongodb-fuzzy-search copied to clipboard
Force to set default_language and language_override when creating index
Hello,
While creating text index for fields, I was not able to do it without specifying { default_language: 'en', language_override: 'en' }
In the documentation, you appear to simply tell the user to:
service.Model.createIndex({ username: 'text' })
which trows an error.
Maybe it is related to mongo version, but I suggest to explain a bit more this part.
Thanks for the great work
please, am having same error. How did you include "{ default_language: 'en', language_override: 'en' }" ? I'm using Mongoose adapter.
@gabrielstuff Thanks for reporting. Which MongoDB version do you use?
Doc for v3.6 states that default_language
is optional and set to english as default: https://docs.mongodb.com/manual/reference/method/db.collection.createIndex/#options-for-text-indexes
What does the thrown error say?
I'm using Mongoose v5.0.0. The error is TypeError: service.Model.index is not a function
Hello, any solution to this?
Use MongoDB instead of mongoose, or read the mongoose documentation on how you set the text index.
Tried using only mongoDB adapter, full text search does not work, it does not return any query search result