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

Confusing error message when specifying non-positive text index weights ('score for word too high')

    • Fully Compatible
    • ALL
    • Hide
      db.newColl.drop()
      db.newColl.ensureIndex({a: 'text'}, {weights: {foo: 0}})
      db.newColl.ensureIndex({a: 'text'}, {weights: {foo: 0}, textIndexVersion: 1})
      
      Show
      db.newColl.drop() db.newColl.ensureIndex({a: 'text'}, {weights: {foo: 0}}) db.newColl.ensureIndex({a: 'text'}, {weights: {foo: 0}, textIndexVersion: 1})
    • Query 11 (03/14/16)

      If you create a text index and specify a field weight of 0 or less, you get a confusing error message: 'score for word too high'. This affects version 1 and version 2 text indexes:

      > db.newColl.ensureIndex({a: 'text'}, {weights: {foo: 0}})
      WriteResult({
      	"nInserted" : 0,
      	"writeError" : {
      		"code" : 16674,
      		"errmsg" : "score for word too high"
      	}
      })
      
      > db.newColl.ensureIndex({a: 'text'}, {weights: {foo: 0}, textIndexVersion: 1})
      WriteResult({
      	"nInserted" : 0,
      	"writeError" : {
      		"code" : 17365,
      		"errmsg" : "score for word too high"
      	}
      })
      
      

      Version: 1ffdd358b9fa048794a09bbc644f6043dde15eeb

            Assignee:
            david.storch@mongodb.com David Storch
            Reporter:
            kamran.khan Kamran K.
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: