Skip to content

Force to set default_language and language_override when creating index #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
gabrielstuff opened this issue Apr 19, 2018 · 7 comments

Comments

@gabrielstuff
Copy link

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

@obirije
Copy link

obirije commented Apr 30, 2018

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

@arve0
Copy link
Owner

arve0 commented May 1, 2018

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

@arve0
Copy link
Owner

arve0 commented May 1, 2018

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?

@obirije
Copy link

obirije commented May 1, 2018

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

@obirije
Copy link

obirije commented May 17, 2018

Hello, any solution to this?

@arve0
Copy link
Owner

arve0 commented May 17, 2018

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

@obirije
Copy link

obirije commented May 18, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants