I’m trying to build a search function for my app based on Meteor, following this tutorial
It all goes well, but where I’m indexing my collection and relevant fields in it, the server crashes with an error from MongoDB (v.2.6.7)
MongoError: Index with pattern: { _fts: "text", _ftsx: 1 } already exists with different options
When I completely erase the ensureIndex(), server runs and enables search but completely agnostic to the values I type. I mean no document in the collection I subscribed to appear regardless of what I searched.
You’re probably right with your points. But indeed I copied the code from the tutorial I linked in the first post. I’m only wondering why it works perfect with the search in his code, but not in mine… I only have changed the relevant parts of the code… The error makes me think that it is definitely a db issue. But don’t know how to fix…
Thanks for suggestions though. I’m only newbie here.
I think you should also post at least a link to this discussion to the tutorial author’s blog so they can chime in.
My only other suggestion would be to try dropping the index in MongoDB, and then after the first time you Meteor app has started remove that _ensureIndex call from your code (e.g. put in somewhere in private so it doesn’t get loaded but you still have it for reference if you need it at some point, e.g. to use it through meteor shell).
Maybe _ensureIndex isn’t yet built to handle the case of a being called for a full-text search index.