Orchard Core Search. Properly configure search in Orchard Core CMS.

Orchard Core Search and Query Lucene Search Index Permissions

Orchard Core has a search feature that allows Orchard Core developers to provide search functionality for the Orchard Core website. Search is automatically enabled as soon as you enable the Lucene feature. The fact that search is automatically enabled is unfortunate and will hopefully be changed, because Lucene queries are useful for a lot more than just search in Orchard Core, and a developer will often want to use Lucene queries without wanting search. As soon as you enable Lucene, when you navigate to "/search" on your Orchard Core website you will be greeted with an unfriendly, but necessary, message:

Search is not configured.

At this point you will want to create and properly configure a Lucene Search Index, making sure you have included the necessary Orchard Core content types and fields as part of the search index. Full-text search requires a bit more configuration if you have searchable content in places other than body parts and display text.

Once you have properly configured search for the Orchard Core website there is a step that is often forgotten and overlooked by the Orchard Core Developer - making sure the Query Lucene Search Index is allowed by the anonymous role! This is easily overlooked by the Orchard Core developer because the developer is often a part of the administrator role and authenticated when developing the website. As such, when the developer searches the Orchard Core website, the search results for the search terms will display accordingly. However, anonymous users will not be able to search the Orchard Core website. Instead, anonymous users will be greeted with the Orchard Core login page, requesting them to authenticate in order to search the Orchard Core website.

As such, the Orchard Core developer needs to allow the anonymous role to have permissions to query the Lucene Search Index. This can be done in the Orchard Core Admin Dashboard. Navigate to Security -> Roles -> Anonymous in Orchard Core and allow permissions to Query Lucene Search Index.

Query Lucene Search Index - Orchard Core

Anonymous users will now be able to search the Orchard Core website for content.