You connect to third party search service by implementing the ISearchService interface and replacing the registration using ServiceBus.RegisterService<isearchservice>(service). ISearchService is the interface of the application service in Sitefinity CMS that is responsible for the full text search capabilities of the system.
ISearchService
ServiceBus.RegisterService<isearchservice>(service)
The default implementation in Sitefinity CMS uses Lucene.Net and stores generated search indexes locally. Sitefinity CMS also includes additional implementations for storing search indexes in the cloud on Azure Search and on Elasticsearch servers.
The default implementations are listed under Settings » Advanved » Search » Search Services. To change the default services, you edit their TypeName field. You can also add your own custom search service implementations.
TypeName
When you implement this interface and replace the default implementation with a your custom one, Sitefinity CMS can interface with other external search services, such as Solr, SharePoint Search, etc.
You replace the default implementation when you register the interface by invoking ObjectFactory.RegisterType. Sitefinity CMS calls the UpdateIndex method of the your implementation when you create and modify each item. It provides a collection of IDocument instances to be added or updated in the index.
ObjectFactory.RegisterType
UpdateIndex
IDocument
The Search method of the registered interface (either the built-in or a custom implementation) is invoked whenever the user uses the Search widget. If the Search widget is not used on your Sitefinity CMS site, the other interface methods can be used in order to run a search query directly through the API.
Search
The Search method takes ISearchQuery as an argument. In the default implementation, the query is instantiated and its ISearchGroup groups are built with the BuildQuery method of the IQueryBuilder interface. You can add or remove groups to the query once it is built. ISearchGroup consists of ISearchTerm and ISearchGroup enumerations. When building the search expression, the group's operator is used between the terms and the groups. ISearchTerm describes a search term with its Field and Value. In most cases, terms contains the search field names and the text that the user is searching for. ISearchFilter defines a search filter for the search query. The filter usually contains static clauses like language filtering, type filtering, date filtering, or any other custom filtering.
ISearchQuery
ISearchGroup
BuildQuery
IQueryBuilder
ISearchTerm
Field
Value
ISearchFilter
In addition to the cloud search and indexing services built into Sitefinity CMS, a full sample of connecting and using Amazon CloudSearch is available on GitHub at Amazon CloudSearch Sample.
Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.
This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.
This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.
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.
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important