This topic describes search functionality in Episerver. Content can be retrieved through listings and searching based on a set of criteria, or through query-based searches. You can use the basic Episerver search, or add Episerver Find to add more powerful search features.
Search in Episerver
To build search functionality, you can for example list pages from a root, or find pages based on a collection of search criteria. See Searching and filtering.
Search in Episerver Commerce also is based on Lucene, but Commerce Manager (the back-end part of Commerce) has its own pluggable search provider API. See Search in the Commerce Developer Guide for information about Commerce-specific search.
You also can use Episerver Find, which is a cloud-ready extension that lets you build advanced customized search features based on your content model. Find requires a separate license.
Built-in search features
Episerver Search has the features listed below.
Full-text search of text in content and files
- You can specify whether you want the results to use exact matching, such as getting a match on plant when you type plan in the search field. To find terms that match a submitted string plus additional characters, add a wildcard, such as plan*.
- You can build a property-based search. The property-based search can be used for searching, for example, for pages with a property set to something specific, or to filter using categories set for the content.
Search across all content types such as pages, blocks, files, videos and images, product content in a Commerce product catalog, and community content. Built-in filtering limits the search results to the type of content.
Note: You do not get search results on content in blocks added in a content area in a template. Usually, this is not a problem because blocks are often used to promote content in a specific source page, which are found when performing the search.
Facets are a type of filtering or grouping, where you present groups (facets) of content to limit the search after getting the first query from the user. You can search on categories and content types, and define which category and type facets you want to filter.
Automatically add items to the search index, such as when you upload a file or publish a page, instead of crawling the entire HTML content of the site, and ensuring better site performance.
Index any type of content
Index any type of content, including content from external systems, using the search web service and an open protocol based on Atom. The index is located in your server domain, and your search feature has direct access to these through the local API.
Access-based search result filtering
Search results are filtered by access rights, ensuring that users see only content to which they have access.
Pluggable search interface
You can replace the built-in Lucene indexing with another index without changing the code on the client, which uses the same API when searching.
The most important related information appears as you type the search phrase, and becomes more specific as you type more characters.
The built-in SearchDataSource control performs multiple types of search in page and file information and content.
You can sort, filter, and configure the output using properties on the web control. Built-in filters cover the most common filtering options. You also can create your own custom filtering methods for more complex filtering. Install an Episerver sample site to explore search functionality using the SearchDataSource control.
For even more control of the outcome when implementing a search solution, you also can work directly towards the ContentSearchHandler, or create your own custom queries. Some configuration and development efforts are needed.
See the Search sections in the Episerver CMS and Commerce Developer Guides, for information and examples about configuring and implementing product-specific search features.
Default search configuration
Episerver search is index-based and is by default using the built-in full-text search feature. When you install Episerver CMS, an index is created and added to the site folder structure. The Episerver Indexing Service then indexes files and documents for the versioned virtual path provider for the website.
Note: The indexing service must be running for the website search to provide search results.
The full-text search in Episerver comes with a set of default values, which usually do not need to be changed. To find out how it works, the full-text search client and service are described in the following topics:
- About Episerver full-text search client
- Configuring Episerver full-text search client
- About Episerver full-text search service
- Configuring Episerver full-text search service
The built-in search provides powerful possibilities when properly set up and configured. However, you should consider the following limitations when implementing Episerver Search.
- The built-in search does not index blocks in content areas. Often these blocks contain linked references to other content and, therefore, do not need to be indexed. If you need to index actual block content, the built-in full-text search cannot deliver this.
- In a load-balanced environment, the supported scenario is to install the search service on one of the machines, and configure that machine in the search settings for other machines.
If you have advanced requirements, we recommend using Episerver Find for your solution.
Search queries in CMS
The following options are available when implementing search queries in Episerver CMS:
EPiServer.Core.ContentSearchHandler is a CMS-specific search handler that handles common scenarios when searching for content. It has methods like GetSearchResults and GetContent to simplify the development process.
- Custom Queries
You can build your own queries to ask the Episerver Search Index by grouping together different queries to find what you are looking for. You can use the following CMS-specific queries: