.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 start working with the .NET API.
To use the .NET API, first add references to the required assemblies, EPiServer.Find.dll
and NewtonSoft.Json.dll
. Next, configure the service URL and default index name in web.config/app.config
.
Open the web.config/app.config
file and add the following:
<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
.
See also Get started with Search & Navigation.
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 9 months ago