Today’s topic is on,
How to enable search feature in Orchard CMS 22.214.171.124!
Most of the web developers who were/are working on Orchard must be shocked to believe that “search feature in Orchard CMS” is by default “Off” and tell that orchard framework search not working or guessing how to enable search in orchard cms. But, not to worry – Search functionality is just turned off by default and will get an error “Please define a default search index“. That doesn’t say – search feature is not available on Orchard CMS.
What you will learn in this tutorial?
1. To enable search feature in orchard cms
2. To add a search box onto your website front-end
I myself wondered how to get this stuff done! That’s when I saw some of the screenshots on this post “Creating-custom-content-types“. Where-in, I saw that there was a “Check-box” field under every display name for every content type created.
[Checkbox] Index this content type for search
But, that particular line didn’t appear with a check-box in any of the content types when I installed Orchard CMS. See below – I have circled it in read.
Then, I thought of creating a field where it would ask the admin to Check/tick the option of indexing any content type created or pre existed. However, you have to enable all the 3 modules including Indexing, Search and Lucene to achieve this as seen here in the Orchard documentation website.
Search feature in Orchard CMS
Can be achieved by enabling some modules that are freely available in the “Module section” of the Orchard CMS Dashboard. Follow all the below steps to enable search in your Orchard CMS.
By default you have to install/enable 3 modules:
Go to Dashboard -> Modules
Since, there are many modules listed out – you can feel free to use the “Filter” feature provided. Just type the module name in the filter box and it will be picked up and shown to you. You have to just click on the enable link on the right top of every module.
Its not yet over – we have still work to be done after this. This is where all the 3 installed modules take their roles.
What we have to do is – Just scroll down you admin dashboard, you will now see “Settings tab“. Click on the arrow located on the right side of the tab. Now you will see few more links have been added. Mainly the Indexes and Search. They were not listed previously before installing the above 3 modules. See below screen shot – I have circled them in read.
Click on the “Indexes” link and it will take you to the “Create Index” page. Where you will be able to create an Index to your content types. If you create one – It will be displayed below all of your content types for you to Check/tick so that the CMS includes that content type to search index.
To be precise – When you create an Index here it will add this:
[Checkbox] Index this content type for “My_Search”
Checkbox - Is replaced with regular HTML input type checkbox
My_Search - Is replaced by the name you give while creating a new Index
Now click on the “Create” button
Once you click on the create button, it will then take you to the index creation page – where you can name the new index that you are about to create. In this case, I’ll name it as “My_Search“.
You should now see the success message!
Now, you can see that the Checkbox has been displayed in the content types for you to select.
Next process is that – You have to go to each custom content type you want to get indexed by, clicking on the “Content definition” on the left side of the dashboard and then clicking on any of the content type listed out there and Check/tick the “Checkbox” that you see above.
So, guys – This is how you enable search feature in Orchard CMS!
Adding a search box to your website front-end
By default your website does not come with a search box on its front-end. You have to manually add one. Please follow my next tutorial on how to add a search box. Below is the link to the next tutorial.
If you are stuck up any where – please feel free to put your questions in the form of comments in the comments section below this post. So that, I can answer your questions.