[SERVER-10879] ensureIndex() on existing text index should not error Created: 24/Sep/13  Updated: 11/Jul/16  Resolved: 28/Feb/14

Status: Closed
Project: Core Server
Component/s: Index Maintenance, Text Search, Usability
Affects Version/s: None
Fix Version/s: 2.6.0-rc1

Type: Bug Priority: Minor - P4
Reporter: Mathias Stearn Assignee: J Rassi
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-12699 Running the same createIndexes comman... Closed
Related
related to SERVER-12980 Background fields are not ignored whe... Closed
Operating System: ALL
Participants:

 Description   

> db.a.drop()
true
> db.a.insert({a: 'apple banana'})
> db.a.insert({a: 'apple apple apple apple'})
> db.a.ensureIndex({a: 'text'})
> db.a.ensureIndex({a: 'text'})
{
        "err" : "Trying to create an index with same name a_text with different key spec { a: \"text\" } vs existing spec { _fts: \"text\", _ftsx: 1 }",
        "code" : 16850,
        "n" : 0,
        "connectionId" : 1,
        "ok" : 1
}



 Comments   
Comment by Githook User [ 28/Feb/14 ]

Author:

{u'username': u'jrassi', u'name': u'Jason Rassi', u'email': u'rassi@10gen.com'}

Message: SERVER-10879 Index build use post-fixed spec to check if index exists

As a result, ensureIndex on an existing text index correctly produces
a no-op. Previously the index catalog would conclude that a
different index existed with the same name, and produce an error.
Branch: master
https://github.com/mongodb/mongo/commit/466ede2ed20cc5abcae3d48b56d78a0eb6e96966

Comment by Githook User [ 28/Feb/14 ]

Author:

{u'username': u'jrassi', u'name': u'Jason Rassi', u'email': u'rassi@10gen.com'}

Message: SERVER-10879 Text index builds validate both "key" and "weights"
Branch: master
https://github.com/mongodb/mongo/commit/b6bcdd964c0a45348273fb5d61763d15a8ddcb3a

Comment by Githook User [ 28/Feb/14 ]

Author:

{u'username': u'jrassi', u'name': u'Jason Rassi', u'email': u'rassi@10gen.com'}

Message: SERVER-10879 Index spec equality check should test all index options
Branch: master
https://github.com/mongodb/mongo/commit/4d51c9ac8769223b5c2db1383325318d31f141b6

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