Reputation: 420
How to add a index to specific database in RavenDb 4. I see the function
new SearchableIndex().Execute(_documentStore)
;
How to specify the database, without setting the default database as part of document store initialization. I wish to pass the database name as parameter.
Upvotes: 1
Views: 105
Reputation: 387
You set the database for the DocumentStore
using the Database
property. When initializing, do it like this:
var _documentStore = new DocumentStore
{
Urls = new[] { "http://localhost:8080" },
Database = "databaseName"
};
new SearchableIndex().Execute(_documentStore);
Upvotes: 1