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

When does mongodb support many text fields?

    • Type: Icon: Question Question
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Text Search
    • None

      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
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            kazankov Sergey Kazankov
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: