[SERVER-9796] Non-text fields in compound text index spec are re-ordered by reIndex or initial sync Created: 28/May/13  Updated: 11/Jul/16  Resolved: 30/May/13

Status: Closed
Project: Core Server
Component/s: Text Search
Affects Version/s: 2.5.0
Fix Version/s: 2.4.5, 2.5.1

Type: Bug Priority: Major - P3
Reporter: Tyler Brock Assignee: J Rassi
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

Create the index:

db.collection.ensureIndex({ words: "text", additional: 1 })
db.collection.getIndexes()
[
  {
    "v": 1,
    "key": {
      "_id": 1
    },
    "ns": "test.collection",
    "name": "_id_"
  },
  {
    "v": 1,
    "key": {
      "_fts": "text",
      "_ftsx": 1,
      "additional": 1
    },
    "ns": "test.collection",
    "name": "words_text_additional_1",
    "weights": {
      "words": 1
    },
    "default_language": "english",
    "language_override": "language",
    "textIndexVersion": 1
  }
]

reIndex() reorders fields:

db.collection.reIndex()
[
  {
    "v": 1,
    "key": {
      "_id": 1
    },
    "ns": "test.collection",
    "name": "_id_"
  },
  {
    "v": 1,
    "key": {
      "additional": 1,
      "_fts": "text",
      "_ftsx": 1
    },
    "ns": "test.collection",
    "name": "words_text_additional_1",
    "weights": {
      "words": 1
    },
    "default_language": "english",
    "language_override": "language",
    "textIndexVersion": 1
  }
]

At this point the index cannot be used as the additional field must appended and not a prefix.



 Comments   
Comment by auto [ 19/Jun/13 ]

Author:

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

Message: SERVER-9796 FTSSpec::fixSpec() should not re-order _fts* fields
Branch: v2.4
https://github.com/mongodb/mongo/commit/ff8827be356c9f443dd1cac252f29634a89cd60b

Comment by auto [ 30/May/13 ]

Author:

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

Message: SERVER-9796 FTSSpec::fixSpec() should not re-order _fts* fields
Branch: master
https://github.com/mongodb/mongo/commit/57a80ea1d0ae34124a5c408466834eda31e4578f

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