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

Amount of keys is not validated in create text index

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Storage Execution
    • ALL

      It's possible to create a text index with more than 32 keys:

      db.test.createIndex(
      {
          "c1": "text",
          "c2": "text",
      ...
          "c33": "text",
          "c34": "text"
      },
      );
      {
              "numIndexesBefore" : 1,
              "numIndexesAfter" : 2,
              "createdCollectionAutomatically" : false,
              "ok" : 1
      } 

      on another side it's validated for ordering index keys

      db.test.createIndex(
      {
          "a1": 1,
          "a2": 1,
      ....
          "a32": 1,
          "a33": 1
      },
      );
      
      "errmsg" : "too many compound keys" 

      that it does not allow to create an index with more than 32 keys.

       

      Same validation has to be added to text index creation to make it consistent.

            Assignee:
            Unassigned Unassigned
            Reporter:
            igor.praznik@mongodb.com Igor Praznik
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: