1

I'm using the Mongoose-Text-Search plugin (https://github.com/aheckmann/mongoose-text-search) to search through my mongodb database, but I'm getting a really confusing error message I've never seen before.

error:  name=MongoError, ok=0, errmsg=error processing query: ns=testdb.data limit=100 skip=0
Tree: TEXT : query=test, language=, tag=NULL
Sort: { $s: { $meta: "textScore" } }
Proj: { $s: { $meta: "textScore" } }
planner returned error: failed to use text index to satisfy $text query (if text index is compound, are equality predicates given for all prefix fields?)

Can someone explain what this means? I think I'm using the text-search plugin correctly, but I can't for the life of me figure out what's wrong here.

Thanks!

pandringa
  • 358
  • 1
  • 3
  • 9

1 Answers1

2
  1. It looks like you created COMPOUND full text search index in Mongodb. And because of this you have to request data from full text search index together with other field. Look here for details: http://docs.mongodb.org/manual/tutorial/limit-number-of-items-scanned-for-text-search/

There are some restrictions like you can't use $gt/$gte/$lt/$lte/$in/$type composed with $and/$or etc for the predicated field. Details here: https://jira.mongodb.org/browse/SERVER-13801

  1. Upgrade to Mongo 2.6.4 and through away Mongoose-Text-Search plugin. The plugin was useful ONLY for Mongo 2.4.x and absolutely redundant for the modern Mongo version. Just use find() method for full text search.
Roman Podlinov
  • 23,806
  • 7
  • 41
  • 60