开发者

How to write a Lucene.Net RAMDirectory back to disk?

I have been working with Lucene.Net and FSDirectory for some time now, so I am familiar with the basics of working with it. However, I am now attempting to rewrite some key code by using RAMD开发者_开发问答irectory's when possible to speed up index use.

Loading an existing FSDirectory into a RAMDirectory is easy enough, just by using the appropriate constructor. However, I can't seem to figure out how I write it back to disk again.

I've seen some mention of a static Directory.copy() method in the Java version, but this doesn't seem to exist in Lucene.Net.

Is this possible?

Update: Turns out I was using an old version of Lucene.Net that didn't support this method. The "official binaries" on the official Lucene.Net site are apparently quite out of date. Thanks to CVertex for suggesting using NuGet to download and install the latest version of Lucene right within Visual Studio.


Directory.Copy static exists as per the Java version

public static void Copy(Lucene.Net.Store.Directory src, Lucene.Net.Store.Directory dest, bool closeDirSrc)

Member of Lucene.Net.Store.Directory

Perhaps you're not looking in right namespace.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜