Try our conversational search powered by Generative AI!

Cannot reindex contents after deleting App_Data\Index folder

Found in

EPiServer.Search 9.0.1

Fixed in

EPiServer.Search 9.0.3

(Or a related package)

Created

Jan 22, 2019

Updated

Feb 04, 2019

Area

CMS Core

State

Closed, Fixed and tested


Description

Steps to reproduce:

Precondition: Install and configure EPiServer.Search in AlloyMVC site - \App_data\Index folder was created.

1. Delete the \App_data\Index folder.
2. Open Admin UI > Admin tab > Tools > Index Site Content.
Note: "Delete old data" option may be selected or not.
3. Click the Start Indexing button

Expected:
_ Searching for published content (e.g. Alloy) returns results.
_ Creates files of indexed content in the folders: \App_data\Index\Main & \App_data\Index\Ref.

Actual:
Does not create files of indexed contents: \App_data\Index\Main is empty, \App_data\Index\Ref is not created, and error log file contains some exceptions like below.

Observed: The issue still happens even after starting indexing again.

2019-01-22 16:07:24,025 [42] ERROR EPiServer.Search.IndexingService.IndexingService: Reset of index: '' failed. Index not found!
2019-01-22 16:07:24,027 [40] ERROR EPiServer.Search.Internal.RequestHandler: Could not reset index '' for service uri 'http://vnlabvm66:1000/mvc2361/IndexingService/IndexingService.svc/reset/?namedindex=&accesskey=local'. Message: The remote server returned an error: (500) Internal Server Error.   at System.Net.HttpWebRequest.GetResponse()
   at EPiServer.Search.Internal.RequestHandler.MakeHttpRequest(String url, String method, IndexingServiceReference indexingServiceReference, Stream postData, Action`1 responseStreamHandler)
   at EPiServer.Search.Internal.RequestHandler.ResetIndex(String namedIndexingService, String namedIndex)
2019-01-22 16:07:29,543 [77] ERROR EPiServer.Search.IndexingService.IndexingService: Failed to search index 'default'. Index seems to be corrupt! Message: Could not find a part of the path 'C:\episerver\vs\mvc2361\App_Data\Index\Ref'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileSystemEnumerableIterator`1.CommonInit()
   at System.IO.DirectoryInfo.InternalGetFiles(String searchPattern, SearchOption searchOption)
   at Lucene.Net.Store.FSDirectory.ListAll(DirectoryInfo dir) in d:\Lucene.Net\FullRepo\trunk\src\core\Store\FSDirectory.cs:line 309
   at Lucene.Net.Index.SegmentInfos.FindSegmentsFile.Run(IndexCommit commit) in d:\Lucene.Net\FullRepo\trunk\src\core\Index\SegmentInfos.cs:line 628
   at Lucene.Net.Index.DirectoryReader.Open(Directory directory, IndexDeletionPolicy deletionPolicy, IndexCommit commit, Boolean readOnly, Int32 termInfosIndexDivisor) in d:\Lucene.Net\FullRepo\trunk\src\core\Index\DirectoryReader.cs:line 117
   at Lucene.Net.Search.IndexSearcher..ctor(Directory path, Boolean readOnly) in d:\Lucene.Net\FullRepo\trunk\src\core\Search\IndexSearcher.cs:line 80
   at EPiServer.Search.IndexingService.IndexingServiceHandler.SingleIndexSearch(String q, NamedIndex namedIndex, Int32 maxHits, Int32& totalHits)
2019-01-22 16:07:29,545 [77] ERROR EPiServer.Search.IndexingService.IndexingService: Failed to delete Document with id: 8ac75760-c57a-4f03-8928-faaf3d3ec49b|en. Message: no segments* file found in Lucene.Net.Store.SimpleFSDirectory@C:\episerver\vs\mvc2361\App_Data\Index\Main lockFactory=Lucene.Net.Store.NativeFSLockFactory: files:
   at Lucene.Net.Index.SegmentInfos.FindSegmentsFile.Run(IndexCommit commit) in d:\Lucene.Net\FullRepo\trunk\src\core\Index\SegmentInfos.cs:line 736
   at Lucene.Net.Index.DirectoryReader.Open(Directory directory, IndexDeletionPolicy deletionPolicy, IndexCommit commit, Boolean readOnly, Int32 termInfosIndexDivisor) in d:\Lucene.Net\FullRepo\trunk\src\core\Index\DirectoryReader.cs:line 117
   at EPiServer.Search.IndexingService.IndexingServiceHandler.DeleteFromIndex(NamedIndex namedIndex, String itemId, Boolean deleteRef)