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

When does mongodb support many text fields?

    XMLWordPrintable

    Details

    • Type: Question
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Text Search
    • Labels:
      None

      Description

      It is very strange that mongodb collection still can have only one text index.
      Do you plan to support text search on multiple indexes?

      This is how it can look like:

      db.col.insert({name: 'dummy', 'keywords': ['key', 'word'], 'description': 'this is a dummy item'});
       
      db.col.ensureIndex({'name: 'short', 'fields': ['dummy', 'keywords']});
      db.col.ensureIndex({'name: 'full', 'fields': ['dummy', 'keywords', 'description']});
       
      db.col.find({'$text': {'$search': 'dummy', '$textIndex': 'short'}}); //short text search for suggest
      db.col.find({'$text': {'$search': 'item', '$textIndex': 'full'}}); //full text search on all fields
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: