Exception caught for 'Search Index'

Topics: Troubleshooting
Oct 18, 2012 at 4:55 PM

Hi, I have an issue with the site search, when I search for anything it shows no results. And when I go to Admin -> Settings -> Search Index I am getting the below exception which is probably related. In addition to this when I go to admin -> settings -> search I can see only a Save button.


Oops. Something went wrong ... sorry

An unhandled exception has occurred and the request was terminated. Please refresh the page. If the error persists, go back

Could not find file 'C:\inetpub\wwwroot\App_Data\Sites\Default\Indexes\Search\segments_5'.

System.IO.FileNotFoundException: Could not find file 'C:\inetpub\wwwroot\App_Data\Sites\Default\Indexes\Search\segments_5'. File name: 'C:\inetpub\wwwroot\App_Data\Sites\Default\Indexes\Search\segments_5' at Lucene.Net.Index.SegmentInfos.FindSegmentsFile.Run(IndexCommit commit) at Lucene.Net.Index.DirectoryReader.Open(Directory directory, IndexDeletionPolicy deletionPolicy, IndexCommit commit, Boolean readOnly, Int32 termInfosIndexDivisor) at Lucene.Net.Index.IndexReader.Open(Directory directory, Boolean readOnly) at Lucene.Services.LuceneIndexProvider.NumDocs(String indexName) in c:\inetpub\wwwroot\Modules\Lucene\Services\LuceneIndexProvider.cs:line 103 at Orchard.Indexing.Services.IndexingService.Orchard.Indexing.Services.IIndexingService.GetIndexEntry(String indexName) in c:\inetpub\wwwroot\Modules\Orchard.Indexing\Services\IndexService.cs:line 59 at Orchard.Indexing.Controllers.AdminController.Index() in c:\inetpub\wwwroot\Modules\Orchard.Indexing\Controllers\AdminController.cs:line 23 at lambda_method(Closure , ControllerBase , Object[] ) at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12() at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)

Coordinator
Oct 18, 2012 at 5:23 PM

Did you try to rebuild the index?

Oct 18, 2012 at 5:31 PM

Can you please tell how I can rebuild the index?

Coordinator
Oct 18, 2012 at 5:37 PM

In App_data\Sites\Default, delete the Index folder.

In 1.6 this won't be an issue anymore, even if the index is corrupted you will be able to Rebuild it from the UI.

Oct 18, 2012 at 6:02 PM

Thank you very much for the fast reply and accurate directions, its working fine now :)