Add indexes for front page properties

This commit is contained in:
Thomas Hounsell 2017-05-16 23:49:21 +01:00
parent f055d910c7
commit b87e303ba9

View File

@ -110,6 +110,24 @@ await _buildCollection.Indexes.CreateOneAsync(Builders<Build>.IndexKeys.Ascendin
Name = "_idx_alt_bstr"
});
}
if (indexes.All(i => i["name"] != "_idx_source"))
{
await _buildCollection.Indexes.CreateOneAsync(Builders<Build>.IndexKeys.Ascending(b => b.SourceType),
new CreateIndexOptions
{
Name = "_idx_source"
});
}
if (indexes.All(i => i["name"] != "_idx_family"))
{
await _buildCollection.Indexes.CreateOneAsync(Builders<Build>.IndexKeys.Ascending(b => b.Family),
new CreateIndexOptions
{
Name = "_idx_family"
});
}
}
[DataObjectMethod(DataObjectMethodType.Select, true)]