Accessing coveo config parameters programmatically
I'm probably missing something simple here but have been trying in vain to retrieve values from the coveo.SearchProvider.config file programmatically and have had no luck.
Basically I'm trying to do something like
var certPath = Sitecore.Configuration.Settings.GetSetting("SearchCertificatePath"); Console.WriteLine(certPath);
I've also tried things like
var certPath = "Sitecore.Configuration.Settings.GetSetting("contentSearch.configuration.defaultIndexConfiguration.SearchCertificatePath");
and have been unable to retrieve anything there either. I'd really like to avoid duplicating this value in appSettings or a dedicated sitecore Settings element if at all possible but also need to be able to retrieve this value from code.
Any help would be greatly appreciated. Thanks!
You could use the ContentSearchManager to retrieve the current Sitecore index, then access the index configuration and cast it into a CoveoIndexConfiguration (which is located in Coveo.Framework.dll, you will need to reference it).
Then you can have access to all the attributes of the config :)