[SERVER-13026] Confusing error message when specifying non-positive text index weights ('score for word too high') Created: 04/Mar/14  Updated: 17/Mar/16  Resolved: 25/Feb/16

Status: Closed
Project: Core Server
Component/s: Index Maintenance, Text Search
Affects Version/s: 2.6.0-rc0
Fix Version/s: 3.3.3

Type: Bug Priority: Minor - P4
Reporter: Kamran K. Assignee: David Storch
Resolution: Done Votes: 1
Labels: 26qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

db.newColl.drop()
db.newColl.ensureIndex({a: 'text'}, {weights: {foo: 0}})
db.newColl.ensureIndex({a: 'text'}, {weights: {foo: 0}, textIndexVersion: 1})

Sprint: Query 11 (03/14/16)
Participants:

 Description   

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



 Comments   
Comment by Githook User [ 25/Feb/16 ]

Author:

{u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}

Message: SERVER-13026 clarify error message for invalid text index weights
Branch: master
https://github.com/mongodb/mongo/commit/fe34b917cddb70f5a38ab199194f891eb9286925

Comment by David Martin-Borregon [ 02/Dec/14 ]

In fact this happens using any value below 1.0

Generated at Thu Feb 08 03:30:24 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.