0

Unable to create index for large data column getting below error

syntax db.APP_AIR.createIndex ({Message : 1})

Btree::insert: key too large to index, failing APP_LOG_11032016.APP_AIR.$Message_1 4058 { : "Back in 2006, we at SSSSfelt compelled to provide the hundreds of millions of underbanked SSSS, who do not have the ability to make payments onl..." }

kindly help me how to resolve this issue..

sKhan
  • 9,694
  • 16
  • 55
  • 53
  • 2
    This is [well documented](https://docs.mongodb.org/manual/reference/limits/#Index-Key-Limit) *"The total size of an index entry, which can include structural overhead depending on the BSON type, must be less than 1024 bytes."*. And in your case this would make perfect sense. It actually looks by the content that you really want a ["text index"](https://docs.mongodb.org/manual/core/index-text/) instead. – Blakes Seven Mar 15 '16 at 07:25
  • Thank you it is working fine using the db.APP_AIR.createIndex ({Message :"text"}) .... kindly advice C# syntax for the same. – Baskar Lakshmi Mar 16 '16 at 04:54
  • It's exactly the same. BSON object naming the field with the content "text". – Blakes Seven Mar 16 '16 at 05:02
  • Refer to my answer following http://stackoverflow.com/a/40422313/1647971. – Rustem K Nov 06 '16 at 09:34

0 Answers0