Click here to Skip to main content
15,887,267 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi

while trying to implement a search using lucene.net , it throws the above error.
the indexes are created in the folder but when the line

C#
Directory dir = FSDirectory.GetDirectory(indexFileLocation, true);
is executed the indexers file is empty and the next statement

C#
Searcher searcher = new IndexSearcher(Lucene.Net.Index.IndexReader.Open(dir));


throws the error :
Server Error in '/' Application.

no segments* file found in Lucene.Net.Store.FSDirectory


What I have tried:

It would be of great help if anyone could help me out in this regard. I have checked for solutions to similar problem in other posts but none of them work!!!!
Posted
Comments
Afzaal Ahmad Zeeshan 11-Nov-17 16:38pm    
It is stating that the file was not found. You should consult the documentation for the library that you are using, it is unsure as to how would that file be expected there.
Member 13514318 12-Nov-17 3:27am    
i deleted the line
Directory dir = FSDirectory.GetDirectory(indexFileLocation, true);
from the code

and modified the searcher as
Searcher searcher = new IndexSearcher(IndexPath ); where IndexPath is the string ...and it works !!!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900