Episerver provides a pretty cool and flexible search, however, it is not installed by default. This guide will talk you through the basics of installing the search and troubleshooting any issues you may encounter.
Enabling The Search By Default
When you first create your Episerver website via the Episerver visual studio template, you will be prompted to install the search.
Tick 'Add Episerver Search'
Installing Episerver Search to a pre-existing website
If you already have a website installed and forgot to enable the 'Add Episerver Search' option, don't panic as you can install it anytime via Nuget. If you need Nuget advice read this article first How To Install EPiServer 7.5 Using the New Visual Studio Extension
In your Episerver Nuget feed search for the Episerver.Search package and install it. Now you have your search installed you should be able to do a search within the editor and receive results:
Trouble Shooting The Search
If you try and do a search in the editor and all it returns is "Content not found" then you may, when searching for either a page name or id, have to do some troubleshooting. A good tip is to try and search for '*'. After that, if the only search result returned is the recycle bin, then read on. When you installed the search it should add a config section in your web.config file, which looks something like this:
In the service name section, make sure the IndexingService Url matches your websites. Try typing it into a browser and you should see this page:
If all is good, the next thing to do is make sure the search is enabled in the admin. In the CMS go to Admin -> Config -> Search Configuration and make sure everything is checked and then click save:
After that, you should try to re-index your website. Next trick is to type into your web browser (where localhost:17129 matches your Episerver Url): http://localhost:17129//EPiServer/CMS/Admin/IndexContent.aspx From here you will be presented with the search index page:
Click the re-index button and your site will re-index. By default your index will be stored in your projects:
App_data -> Index -> Main
Index files should now be generated within this folder. If you can't see anything in here, then it's likely you don't have the correct Windows permissions set on the folder. If you have the files then you should be all set. Go back to your editor search type in * and you should see some results :)
In today's article, we've covered how to set-up Episerver search. When you first install the site you can simply include it as a build option, or, you can add it in later via Nuget. After you have installed the search, we've gone over some basic steps to help you troubleshoot why you have no search results.