How to implement Lucene .Net search on Azure webrole

半世苍凉 提交于 2019-12-02 04:12:26

I have actually used that exact version of Lucene.NET with AzureDirectory and it doesn't work well. AzureDirectory in my opinion is not written for production scale.

If you look at the source code for AzureDirectory, it is using:

  • older version of Lucene as a base (2.3x)
  • exceptions are thrown everywhere (hard to debug/catch the right ones in production)
  • it uses the old storage API (pre 1.8 version of the SDK)

I ended up creating my own dedicated Virtual Machine and using the .net 3.0.3 Lucene.Net library. Works like a champ in that environment, since I do not need to implement AzureDirectory.

You should have only ONE IndexWriter that is easy to implement with a storage queue. You can have multiple IndexReaders if you want to limit them write a IndexReader pool (like a SQL connection pool). I have multiple of those run fine with no exceptions flying around like they where with AzureDirectory.

My environment is a bit different lots of smaller indexes....not one massive one.

Maybe this is the AzureDirectory that people are talking about, maybe not - I tweaked this in order to get better performance. While I won't claim that it's production-grade and rock solid, it may help you over the AzureDirectory that you are currently using.

Hope it helps,

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!