I can't use $meta operator with $text search and score.

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: 3.2.2
    • Component/s: Query Operations
    • None
    • Environment:
      Java Spring MVC, Mongo Java Driver 3.2.2, Mac OS X El Capitan, Romobongo
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Hello I have a problem in my Java & mongodb web project. I am using Mongo Java Driver. I am doing text search. However when i use $meta operator with text search it gives this error:
      com.mongodb.MongoQueryException: Query failed with error code 2 and error message 'unknown operator: $meta' on server localhost:27017

      my code is:

      FindIterable<Document> iterable = db.getCollection("users").find(
      new Document("$text", new Document("$search", searchInput).append("$caseSensitive", false))
      .append("score", new BasicDBObject("$meta", "textScore" )) );

            Assignee:
            Unassigned
            Reporter:
            Onur Demirta?
            None
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: