indexing - Getting Error While Creating Text Index in MongoDB -
db.inventory.createindex( {'category.name': 'text', 'brand.name': 'text', 'name': 'text', 'store.name': 'text', 'collection_1' : 'text', 'sku' : 'text', 'parent_sku' : 'text' })
while using commands getting error "exception: namespace name generated index name"
i'm using because m creating full text index in application.. have required many fields search index.. should have do...????
you error when auto generated index name long. index name generated concatenating different column names, however, length limited 125 characters according documentation. can resolve error manually specifying shorter index name when creating index:
db.inventory.createindex({ 'category.name': 'text', 'brand.name': 'text', 'name': 'text', 'store.name': 'text', 'collection_1': 'text', 'sku': 'text', 'parent_sku': 'text' }, { name: "myindex1" } )
Comments
Post a Comment