Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-814

Unable to create a full text index on $**

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 2.11.2, 2.12.0
    • 2.11.0
    • None
    • None

    Description

      There's an Exception where I try to create an FTS index on $**. FTS on regular fields (e.g.

      {a:"text"}

      ) seems to work as expected.

      Below was done with java driver commit 8ca48fafa84fdfa41e6b7e2d8bbca5cf8151fca8 on master.

              Mongo mongo = new MongoClient("localhost", 27000);
              DBCollection coll = mongo.getDB("test").getCollection("a");
              
              DBObject key = new BasicDBObject("$**", "text");
              coll.ensureIndex(key);       

      Exception in thread "main" com.mongodb.MongoException: invalid operator: $**
      	at com.mongodb.MongoException.parse(MongoException.java:82)
      	at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:292)
      	at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:273)
      	at com.mongodb.DBCollection.findOne(DBCollection.java:728)
      	at com.mongodb.DBCollection.findOne(DBCollection.java:670)
      	at com.mongodb.DBApiLayer$MyCollection.createIndex(DBApiLayer.java:342)
      	at com.mongodb.DBCollection.createIndex(DBCollection.java:485)
      	at com.mongodb.DBCollection.ensureIndex(DBCollection.java:561)
      	at com.mongodb.DBCollection.ensureIndex(DBCollection.java:512)
      	at TestEnsureIndex.main(TestEnsureIndex.java:14)

      Attachments

        Activity

          People

            Unassigned Unassigned
            steve.briskin Steve Briskin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: