Meteor-Community-Packages / meteor-schema-index

Control some MongoDB indexing with schema options
MIT License
38 stars 17 forks source link

text index for multiple fields #6

Open jcollado opened 8 years ago

jcollado commented 8 years ago

When trying to create a text index for multiple fields in a collection, the index creation fails.

My guess is that instead of creating one text index with multiple fields, the creation of multiple text indexes is attempted and that fails because only one text field is allowed per collection in MongoDB.

aldeed commented 8 years ago

Can you post some code that causes the error?

wesleyfsmith commented 7 years ago

I am able to trigger this error when I do the following in my schema:

new SimpleSchema(
{
    type: String,
    optional: true,
    index: 'text'
  },
  setting: {
    type: String,
    optional: true,
    index: 'text'
  },
  brand: {
    type: String,
    optional: true,
    index: 'text'
  });

Would be able to get this fixed to be able to search multiple indexes.