6

What is the best way to add indexes on existing objects mapped to DDS? Several hundred thousand objects already stored in the database.

Is it as easy as just adding [EPiServerDataIndex] atttribute to my existing classes, recompile and redeploy the site?

flalar
  • 1,181
  • 3
  • 12
  • 23

1 Answers1

3

Seems your options are to either:

1) Add [EPiServerDataIndex] attributes or...

2) Add indexes through store parameters when creating your store:

var params = new StoreDefinitionParameters(); storeParams.IndexNames.Add("SomeModelPropertyName"); var store = DynamicDataStore.CreateStore<YourType>("StoreName", params);

More info here

Tharif
  • 13,794
  • 9
  • 55
  • 77
Ted Nyberg
  • 7,001
  • 7
  • 41
  • 72
  • Thanks for your reply Ted. So, just annotate the properties of the objects with [EPiServerDataIndex] and indexes will be added. Question is how this will affect objects already stored in DDS. – flalar Apr 21 '15 at 12:07
  • The index should apply to items already stored, but I'm not 100 % sure about the DDS internals. – Ted Nyberg Apr 21 '15 at 13:11