Reputation: 4605
I am trying to integrate Lucene.Net in a web app. So I downloaded the sample project from this CodeProject article.
But when I try it I keep getting 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:
The error occurs in this line
using (var searcher = new IndexSearcher(_directory, false))
Did anyone face this error ?
Upvotes: 4
Views: 3954
Reputation: 2919
The Lucene need to create indexes before it can search. It looks like index files are missing in the directory specified.
Did you click Create Index button in UI? If so what happens, it is supposed to create "lucene_index" directory under MVC site, if it didn't, make sure to give account running website read/write access to that directory.
Upvotes: 5