You can use this method when starting the application without worrying about performance.
public static void CreateIndexesForDatabases(Assembly assemblyToScanForIndexingTasks, IDocumentStore documentStore, string[] databases) { var catalog = new CompositionContainer(new AssemblyCatalog(assemblyToScanForIndexingTasks)); foreach (var database in databases) { IndexCreation.CreateIndexes(catalog, documentStore.DatabaseCommands.ForDatabase(database), documentStore.Conventions); } }
just remember to include Raven.Client.Extensions
Daniel Lang
source share