.NET client API
Introduces the .NET client API for Optimizely Search & Navigation. This is a fluent (chained) API, providing a readable code that lets you index and search for actual domain objects with great flexibility.
The .NET client API for Optimizely Search & Navigation is built on the premise of "convention over configuration," meaning it "just works" using a set of default conventions. Using code, you can customize these conventions to suit your needs. This topic describes configuring Optimizely Search & Navigation to work with the .NET API.
To use the .NET API, add references to the required assemblies, EPiServer.Find.dll
and NewtonSoft.Json.dll
. Then configure the service URL and default index name in web.config/app.config
by adding the following code:
<configuration>
<configSections>
<section name="episerver.find"
type="EPiServer.Find.Configuration, EPiServer.Find"
requirePermission="false"/>
</configSections>
<episerver.find serviceUrl="http://..." defaultIndex="myindex"/>
</configuration>
You can also configure the service URL and default index name in the appSettings
section like this:
<configuration>
<add key="episerver:FindServiceUrl" value="https://inte.find.episerver.net/test" />
<add key="episerver:FindDefaultIndex" value="test" />
</configuration>
The .NET client API can get settings from the Web.config/configSections
or Web.config/appSettings
section. The settings value in appSettings
takes higher priority and overwrites the value in configSections
.
Next, create an instance of the Client
class and start working with the Find service. See Client class for more details about next steps.
Updated about 10 hours ago