Directory lock error with Lucene.Net usage in an ASP.NET MVC site

后端 未结 6 2284
陌清茗
陌清茗 2021-02-13 21:29

I\'m building an ASP.NET MVC site where I want to use Lucene.Net for search. I\'ve already built a SearchController and all of its methods, but I\'m getting an error at runtime

6条回答
  •  萌比男神i
    2021-02-13 21:51

    I encountered the same issue and I was using an IProviderContext. In my case I had to: Optimize,Commit and Dispose the ProviderContext.

    providerContext.Optimize();
    providerContext.Commit();
    providerContext.Dispose();
    

    I hope this helps. After implementing the above snippet, my index rebuilt successfully.

提交回复
热议问题