-
Type: Question
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Query Language, Text Search
-
None
-
Query Optimization
Once we are able to execute text predicates outside of an index (SERVER-17648), this ticket tracks the work to compete plans using an fts index against plans using 'normal' indexes applying the text filter afterwards.
Original Description
We have a collection of items with approx. 1.5 million documents. When we run this query:
db.items.find({ "PId" : ObjectId("5ffc8133d1cd2617a4dadbf6") }).count()
A value of 12 is returned i.e. there are 12 documents with the PId specified in the query. This query pretty much returns instantly.
However, running the following query takes around 45 seconds to run and returns a value of 2:
db.items.find({ "PId" : ObjectId("5ffc8133d1cd2617a4dadbf6"), "$text" : { "$search" : "\"average rainfall\"" } }).count()
So of the 12 matching documents, 2 have average rainfall in the properties.
So it appears that the first query does not do anything and that the text search is taking priority. Is this the case? Is this a bug or is there a way to prioritise the order in which the queries are executed?
- depends on
-
SERVER-17648 Implement matcher for text predicates
- Backlog