var indexDefinition = new IndexDefinition { Name = "MyIndex", Map = @"from doc in docs select new { doc.Id, doc.Name }" };
var indexDefinition = store.DatabaseCommands.GetIndex("MyIndex"); indexDefinition.Reduce = @"from result in results group result by result.Id into g select new { Id = g.Key, Count = g.Count() }"; store.DatabaseCommands.PutIndex("MyIndex", indexDefinition);
var indexDefinition = store.DatabaseCommands.GetIndex("MyIndex"); indexDefinition.Priority = IndexPriority.Normal; store.DatabaseCommands.PutIndex("MyIndex", indexDefinition);These examples demonstrate how the IndexDefinition class can be used to create and modify indexes in RavenDB. The package library for RavenDB is RavenDB.Client, which provides a set of client-side libraries for working with RavenDB.