feathers-mongodb-fuzzy-search icon indicating copy to clipboard operation
feathers-mongodb-fuzzy-search copied to clipboard

Force to set default_language and language_override when creating index

Open gabrielstuff opened this issue 6 years ago • 7 comments

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

gabrielstuff avatar Apr 19 '18 21:04 gabrielstuff

please, am having same error. How did you include "{ default_language: 'en', language_override: 'en' }" ? I'm using Mongoose adapter.

obirije avatar Apr 30 '18 16:04 obirije

@gabrielstuff Thanks for reporting. Which MongoDB version do you use?

arve0 avatar May 01 '18 08:05 arve0

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?

arve0 avatar May 01 '18 08:05 arve0

I'm using Mongoose v5.0.0. The error is TypeError: service.Model.index is not a function

obirije avatar May 01 '18 20:05 obirije

Hello, any solution to this?

obirije avatar May 17 '18 20:05 obirije

Use MongoDB instead of mongoose, or read the mongoose documentation on how you set the text index.

arve0 avatar May 17 '18 20:05 arve0

Tried using only mongoDB adapter, full text search does not work, it does not return any query search result

obirije avatar May 18 '18 08:05 obirije