开发者

use a virtual file system with Lucene.NET

Is there a way to use a virtual 开发者_Python百科filesystem with Lucene.NET? Based on my (moderate) experience with Lucene, I suspect the answer here is no; but just in case (...) barring that:

Or is there an existing Contrib module or add-on for Lucene.NET that adds VFS support?


You can do this by implementing Lucene.Net.Store.Directory. The xmldoc for this abstract class is very didactic:

A Directory is a flat list of files. Files may be written once, when they are created. Once a file is created it may only be opened for read, or deleted. Random access is permitted both when reading and writing.

Java's i/o APIs not used directly, but rather all i/o is through this API. This permits things such as:

  • implementation of RAM-based indices;
  • implementation indices stored in a database, via JDBC;
  • implementation of an index as a single file;

Directory locking is implemented by an instance of LockFactory, and can be changed for each Directory instance using setLockFactory.

Here's an example of implementing a custom Directory to support Azure.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜