EpiFind is a power search provider developed by EpiServer; if you've stumbled across this post and you're considering using EpiFInd I suggest you read this article, Review Of The Different Search Providers Available To Use On Your Episerver Project. In today's post, I'll cover some basic code snippets to query Find.

Performing A Basic Search

Performing a search is pretty easy. The best approach to query find is to inject the Find API, IClient. In this example, I'm returning a PageData object, we can then use the standard PageData properties to display that search result: like:

For those of you who are interested in the old singleton version,SearchClient, looks like this:

Querying finds EpiFind results in the ContentResult object being returned. ContentResult has several useful bits of data, like facets, total results and the search results themselves. To get the search results, you can use this code:

You can get the total number of results returned, like:

If you want to only search for certain content types, you can do that like this:

To get the facets, you can use this snippet:

EpiFind is very simple to get started with and offers a pretty powerful API. In today's post, I've covered some of the basic bog-standard ways to query find and display those results on your website.