适用于 Lucene.Net 的 Azure 库 - FileNotFound 异常
我正在使用 Lucene.Net 的 Azure 库,但当我尝试附加到索引时遇到 FileNotFound 异常。
FSDirectory 的一切工作都非常顺利。我有大量针对 RAMDirectory 的单元测试,效果非常好。
这是基础设施:
- Single Role 维护 Index Writer Singleton。
- 单独的 Web 服务维护搜索器的单个实例,该实例以只读模式指向同一索引。
- 当发生更改事件时,索引写入者角色将拾取更改、修改索引并提交。
- 一段时间后,搜索器会回收以获取最新的索引更改。
异常:更改后,从那时起,我会从 AzureDirectory 收到 FileNotFound 异常。该文件报告为未发现更改,但一个示例是“_h.cfs”。当搜索器回收并尝试重新加载索引时,我也会在搜索器上收到 FileNotFound 异常...
其他重要点: 1. 完整索引的初始创建工作正常。 2. 根据最初创建的索引进行搜索效果很好。 3. 我正在使用 Lucene .Net V。 2.9.2
有什么想法或建议吗?不幸的是,这是我在发布项目之前需要解决的最后一个问题......
谢谢, 蒂姆
I'm working with the Azure Library for Lucene.Net but I am running into FileNotFound Exceptions when I try to append to the index.
Everything works great with the FSDirectory. I have a ton of unit tests working great against the RAMDirectory.
Here is the infrastructure:
- Single Role maintains Index Writer Singleton.
- Separate web service maintains a single instance of the Searcher that points to the same index in read-only mode.
- When a change events occur the Index Writer Role picks up the change, modifies the index, and commits.
- After a certain period of time the Searcher recycles to pick up the latest index changes.
Exceptions: Upon the change, and from then on, I get a FileNotFound exception from the AzureDirectory. The file reported as not found changes but one example is "_h.cfs." When the searcher recycles and attempts to reload the index I get FileNotFound exceptions on the searcher as well...
Couple Other Important Points:
1. Initial creation of the full index works fine.
2. Searching against the initially created index works fine.
3. I'm using Lucene .Net V. 2.9.2
Any thoughts or suggestions? This is unfortunately the last issue I need to resolve before releasing the project...
Thanks,
Tim
我使用 https://azuredirectory.codeplex.com/ 遇到了同样的问题,
我最终使用了本地资源( web/worker 角色上的一个文件夹)将整个索引加载到 blob 存储中或从 blob 存储中加载,然后使用 lucene.net 中内置的索引编写器,每隔几分钟将文件推送回 blob 存储,以便其他读者可以加载和搜索索引。
总的来说,AzureDirectory 实现基本上只是一个玩具示例,需要更多的工作才能在生产环境中发挥作用。
I ran into the same problem using https://azuredirectory.codeplex.com/
I ended up using a localresource (a folder on your web/worker role) to load the entire index to and from blobstorage, then using the built in indexwriter in lucene.net and pushing the files back to blob storage every few minutes, so other readers could load and search the index.
Overall the AzureDirectory implementation was basically just a toy example, that needed more work to be useful in a production setting.