使用AzureDirectory与Lucene.NET 3.0.3.0 [英] Use AzureDirectory with Lucene.NET 3.0.3.0

查看:255
本文介绍了使用AzureDirectory与Lucene.NET 3.0.3.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我下载AzureDirectory和最新Lucene.NET
根本无法编译

I download AzureDirectory and with latest Lucene.NET Simply cannot compile

错误很多像

'Lucene.Net.Store.Azure.AzureDirectory不实现继承的抽象成员Lucene.Net.Store.Directory.Dispose(布尔)

有没有新的AzureDirectory可以与Lucene的3?

Is there any new AzureDirectory that can work with the Lucene 3?

推荐答案

工作我已经测试Lucene.Net.Store.Azure 1.0.5.1与Lucene.Net 3.0.3它为我工作。我用下面的步骤,所以你可以尝试,以及:

I have tested the Lucene.Net.Store.Azure 1.0.5.1 with Lucene.Net 3.0.3 which worked for me. I used the following steps so you can try as well:


  1. 创建一个Windows Azure的工作者角色在VS2010

  2. 这里包括Lucene.NET.Store.Azure(1.0.5.1) (这对Lunece.NET 2.9.4.1及以上依赖)使用VS包管理器

  1. Created a Windows Azure Worker Role in VS2010
  2. Included Lucene.NET.Store.Azure (1.0.5.1) from here (which has dependency on Lunece.NET 2.9.4.1 and above) using VS Package Manager

下午2时01>安装封装Lucene.Net.Store.Azure

2.1 PM> Install-Package Lucene.Net.Store.Azure

这是从我的这里其删除Lucene.net 2.9.4.1,并安装3.0.3位

After that I updated Lucene.net to 3.0.3 RC from here which removed Lucene.net 2.9.4.1 and installed 3.0.3 bits

下午3点01分>安装封装Lucene.Net - 预

3.1 PM> Install-Package Lucene.Net -Pre

经过验证的,我有最新位和所有的依赖在我的项目设置,我添加了下面的测试代码在我的辅助角色:

Verified that I have latest bits and all the dependency set in my project, I added the following test code in my worker role:

Lucene.Net.Util.Version version = Lucene.Net.Util.Version.LUCENE_30;
Microsoft.WindowsAzure.CloudStorageAccount cloudAccount = Microsoft.WindowsAzure.CloudStorageAccount.FromConfigurationSetting("CloudStorageSetting");
var cacheDirectory = new RAMDirectory();
AzureDirectory azureDirectory = new AzureDirectory(cloudAccount, "MyCloudIndex",cacheDirectory);
IndexWriter indexWriter = null;
Analyzer analyzer = new StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_30);
indexWriter = new IndexWriter(azureDirectory, analyzer, IndexWriter.MaxFieldLength.UNLIMITED); 
Document doc = new Document();
indexWriter.AddDocument(doc);
indexWriter.Dispose();
azureDirectory.Dispose();


在没有编译错误和作用做了做工精细,所以你可以尝试同样的看看。

The was no compilation error and the role did work fine so you can try the same and see.

这篇关于使用AzureDirectory与Lucene.NET 3.0.3.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆