Search with accented characters

Sitefinity CMS uses the Lucene search provider by default. Lucene uses the so-called analyzer classes to examine indexed terms from text and generate a token stream. To implement an accent-insensitive search in Sitefinity CMS, you replace the default analyzer used by Lucene with one that replaces accented characters with the corresponding unaccented ones.

Lucene provides several filter classes, for example, the ASCIIFoldingFilter class, which you can use to customize the search functionality and convert special characters.

For more information, see:

The following example demonstrates how to implement a custom analyzer class:

In the code above, you use the ASCIIFoldingFilter class to filter the result in the token stream of the custom analyzer.

To enable Lucene to use your custom analyzer in Sitefinity CMS, you need to register the custom analyzer in Sitefinity CMS using the ObjectFactory class. You do this in the Application_Start method of your Global.asax class:

RESULT: Your new analyzer class is used during indexing. This means that any accented characters are replaced with their unaccented equivalents only during indexing and not during searching.

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Web Security for Sitefinity Administrators

The free standalone Web Security lesson teaches administrators how to protect your websites and Sitefinity instance from external threats. Learn to configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?

Next article

Index external content