"No segment files * found" error when trying to search the Lucene directory

I am trying to integrate Lucene.Net into a web application. So I downloaded the sample project from this CodeProject article .

But when I try, I get this message in the Search method

No segments * file found in
[My directory] \ Lucene.Net-search-MVC-sample-site-master \ LuceneSearch.Mvc \ lucene_index
lockFactory = Lucene.Net.Store.NativeFSLockFactory: files:

Error in this line

 using (var searcher = new IndexSearcher(_directory, false)) 

Has anyone encountered this error?

+4
source share
1 answer

Lucene needs to create indexes before doing a search. It seems that index files are not in the specified directory.

Have you clicked the Create Index button in the user interface? If this happens, you are supposed to create the "lucene_index" directory on the MVC website, if this is not the case, be sure to specify the account on which read / write access to the website is running.

+5
source

Source: https://habr.com/ru/post/1488041/


All Articles