---
title: Setting up search on your website
related:
  - https://docs.kentico.com/k82/custom-development/miscellaneous-custom-development-tasks/smart-search-api-and-customization.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

Kentico provides an index-based search engine (Smart search), which allows users to search through the content of websites and various types of data within the system. The smart search is based on [**Lucene.Net**](http://lucenenet.apache.org/) (version 3.0.3) — a source code, class-per-class, API-per-API port of the Java **[Lucene](http://lucene.apache.org)** search engine to C# and the .NET platform.

The smart search uses **indexes** to store information about the website content. When a user sends a search request, the system searches through the appropriate indexes, which results in **significantly better performance** compared to linear SQL query search.

To set up the smart search functionality on your website, you need to perform the following steps:

1. [Enable](https://docs.kentico.com/k82/configuring-kentico/setting-up-search-on-your-website/enabling-search-indexing.md) smart search indexing in the system.
2. [Create search indexes](https://docs.kentico.com/k82/configuring-kentico/setting-up-search-on-your-website/creating-search-indexes.md). Assign the indexes to your site and define their exact content.
3. Add smart search web parts onto the pages of your website. To learn more about the web parts, see [Adding search functionality to pages](https://docs.kentico.com/k82/configuring-kentico/setting-up-search-on-your-website/adding-search-functionality-to-pages.md) and [Using search filters](https://docs.kentico.com/k82/configuring-kentico/setting-up-search-on-your-website/using-search-filters.md).

## How the smart search works

The system stores the content of smart search indexes in physical **index files** on the server's disk. The index files are located in the **\~/App\_Data/CMSModules/SmartSearch/** folder within your web project directory

Pages, forums and other Kentico objects are reflected in the index file as **index documents**. The data structure of the index documents is suitable for being searched, resulting in significantly higher search performance compared to linear SQL search.

The index documents contain the same fields as the corresponding Kentico objects, based on the search settings of individual object types. Depending on these settings, the **Index writer** creates representations of objects in the index files. When an object included in the index is created, removed or has one of its fields modified, the system automatically schedules an **Indexing task**, which updates the corresponding index document. The **Index searcher** searches through the index file and returns relevant results.

> **Tip:** **Tip**
>
> You can find a list of all indexing tasks that are waiting to be processed in **Smart search -> Tasks**. Here you can:
>
> - Look for information if you encounter problems with new content not being indexed correctly
> - **Delete** () tasks from the indexing queue to stop unnecessary or problematic indexing
>
> See also: [Monitoring search indexing tasks](https://docs.kentico.com/k82/configuring-kentico/setting-up-search-on-your-website/monitoring-search-indexing-tasks.md)

> **Note:** **Executing search tasks via the scheduler on a web farm**
>
> If your environment runs in a web farm, you need to configure the **Execute search tasks** scheduled task to be executed on each of the web farm servers individually. See [Configuring scheduled tasks to be executed on every server of a web farm](https://docs.kentico.com/k82/configuring-kentico/optimizing-website-performance/setting-up-web-farms/configuring-web-farm-servers.md#configuring-scheduled-tasks-to-be-executed-on-every-server-of-a-web-farm).

### Example

The following model scenario explains the life cycle of a page in a search index file:

1. A user creates a new page.
2. Upon the page's creation, the system logs a new indexing task in the database.
3. The Smart search either runs the indexing task immediately or processes it later using a scheduled task.
4. When executed, the indexing task adds the new page to the appropriate search indexes. The system indexes the page's content based on the search field settings defined for the given page type.
5. A user arrives on the website and sends a search request via a Smart search web part.
6. The web part searches through the assigned indexes and returns results based on the found data.
