Last updated: Apr 21 2015

Area: Episerver Find Applies to versions: Latest

4. Adding search functionality

This section outlines additional Find-based search functionality that you can add. Here, we assume that you have a working website with Find, and basic search functionality is installed.

Note: You need to enable features like statistics, best bets, and synonyms, since they are not enabled by default.

Statistics tracking and viewing

Search Statistics provides an API for tracking searches and retrieving their statistical data. The aggregated statistics are also used for features like spelling suggestions, and related queries.

If you are using Unified Search, add a Track statement to a search query to enable the accumulation of statistics.

How to do it

Pagination

The default number of returned search results is limited to 10. Using the Skip and Take methods, you can override this and define the number of search results that should be returned in total, and on the search page with pagination.

How to do it

Highlighting search results

Highlighting of matching search keywords is helpful when evaluating search results. Highlights can be requested as part of projection expressions passed to the Select method. You can also use Unified Search to register a highlighted excerpt for a specific document type.

How to do it

Searching in blocks

Blocks are smaller content items which can be added to a page, and reused on the website. Since blocks must be shown in page context, they do not have a URL and are not indexed by default. However, there are methods to achieve content area indexing, and to control the indexing of specific block types.

How to do it

Filters and facets

Search requests are made up of queries and filters, where filtering is applied to narrow down search results. Facets are used for presenting aggregated data based on a search query. When searching a product catalog, you can for instance let the website visitor restrict results based on product types or price ranges. Facets can be used in combination with filters.

How to do it

Best bets

Best bets allow search administrators to promote selected content from the Find admin view. Bets bets appear at the top of the search results, as higher boosting is applied to them. You can add best bets through the ApplyBestBets extension method using Unified Search, or by applying the method to indexed arbitrary types.

How to do it

Synonyms

Synonyms are useful when you want the search to cover more phrases and return more relevant search hits. Also, visitors may use different terms to describe the same content. Add synonyms to search results via the UsingSynonyms extension method.

How to do it

Restricting search results to diacritic characters

When submitting a free text search that contains diacritic characters, Find results include both the diacritic and non- diacritic versions of the same character. For instance, the free text search 'Ånge' returns Ange, Änge, etc.

To have the basic search return results that include only the submitted diacritic characters, follow these steps.

  1. When the Find index is created, include the language that includes the diacritic character (for example, Swedish).

  2. Add that language to the search query. For example:
    (SearchClient.Instance.Search<PageData>(Language.Swedish)...

Comments