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

Collation causes issue with a certain find condition

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 4.0.1
    • Component/s: Text Search
    • Labels:
      None
    • ALL
      1. Create a Collection "Plan"
      2. Create index for full text search
      3. Add a few records
      4. Run the query

      I have a query - 

      db.getCollection('Plan').find(
          {$or:[
              {"_id":{$in:["PLN000000020","PLN000000014"]}},
              {$text:{$search:"test"}}]
          })
          .sort( { "name": 1 })
          .skip(0)
          .limit(10)
          .collation({locale:'en'})
      

      There is an index on '_id' and a Full text search index ("$**":"text")

      This query fails saying -

      error processing query: ns=Apeiron.Plan limit=10Tree: $or\n    _id $in [ \"PLN000000014\" \"PLN000000020\" ]\n    TEXT : query=test, language=english, caseSensitive=0, diacriticSensitive=0, tag=NULL\nSort: { name: 1.0 }\nProj: {}\nCollation: { locale: \"en\" }\n planner returned error: Failed to produce a solution for TEXT under OR - other non-TEXT clauses under OR have to be indexed as well.
      

      Is there a workaround for it ? How do I specify collation of a collection along with full text search index?

            Assignee:
            daniel.hatcher@mongodb.com Danny Hatcher (Inactive)
            Reporter:
            pnarendr Prateek Narendra
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: