An Microsoft DI extension to Cogworks.AzureSearch.
_composing.RegisterAzureSearch()
.RegisterClientOptions("[AzureSearchServiceName]", "[AzureSearchCredentials]")
.RegisterIndexOptions(false, false) // for now required
.RegisterIndexDefinitions<FirstDocumentModel>("first-document-index-name")
.RegisterIndexDefinitions<SecondDocumentModel>("second-document-index-name")
.RegisterIndexDefinitions<ThirdDocumentModel>(new Index{
Name = "third-document-index-name",
ScoringProfiles = new List<ScoringProfile>()
{
new ScoringProfile("global-sp", new TextWeights(new Dictionary<string, double>()
{
{"Name", 10}, {"Content", 0.1}, {"Tags/Name", 0.1}
}),new List<ScoringFunction>()
{
new FreshnessScoringFunction("PublishDate", 20, TimeSpan.FromDays(180), ScoringFunctionInterpolation.Quadratic)
})
} //and more custom properties to add
})
.RegisterDomainSearcher<SomeDomainSearch, ISomeDomainSearch, FirstDocumentModel>();
- Cogworks.AzureSearch is licensed under the Apache License, Version 2.0
This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. For more information, see the .NET Foundation Code of Conduct.
Please... Spread the word, contribute, submit improvements and issues, unit tests, no input is too little. Thank you in advance <3