IMPORTANT: This version of Sitefinity CMS is out of support and the respective product documentation is no longer maintained and can be outdated. Use the version selector to view a supported product version.
In Sitefinity's default search provider - Lucene.Net, you cannot search using underscores, as well as spaces and other punctuation.
By default, Sitefinity CMS uses its ObjectFactory to register Lucene default term analyzer - StandardAnalyzer. This analyzer splits strings by special characters. For example, searching the term news_item results in searching both news and item, rather than the complete string news_item. In such a case the user get the wrong results or no results at all.
To overcome this, you can use an alternative term analyzer - KeywordAnalyzer. You must register it using ObjectFactory, in the following way:
ObjectFactory.Container.RegisterType<Analyzer, KeywordAnalyzer>(
new
ContainerControlledLifetimeManager());
NOTE: KeywordAnalyzer does not split words in the searched term and takes the entire field text as a single token.
Once you register the analyzer, you must reindex the site.
Back To Top
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important