Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-55896

Mongo full text search on a small collection (approx. 1.5 million entries)

    • Type: Icon: Question Question
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Index Maintenance
    • None

      We have a collection with approx. 1.5 million rows.

      We have a full text search index created in code as follows:

      m_itemsCollection.CreateIndex(IndexKeys.TextAll(), IndexOptions.SetTextDefaultLanguage("none"));

      Running a query on the database as follows:

      db.items.find({ "$text" :

      { "$search" : "\"average\"" }

      }).count()

      Takes around 5 seconds to return a value of 250000 which is not terrible but not fast either.

      Running the following query however:

      db.items.find({ "$text" :

      { "$search" : "\"average rainfall\"" }

      }).count()

      Takes around a minute to return a value of 200000.

      The queries are using an IXSCAN as expected but why are they so slow? The documents are not particular complicated.

      We are using Mongo 3.6.8. We could upgrade if there are performance improvements in later versions but we need to understand why text search is so slow as it is unusable at the moment.

       

       

            Assignee:
            Unassigned Unassigned
            Reporter:
            ihannah@meniscus.co.uk Ian Hannah
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: