如何实现在Azure上webrole Lucene的净搜索 [英] How to implement Lucene .Net search on Azure webrole

查看:136
本文介绍了如何实现在Azure上webrole Lucene的净搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用AzureDirectory和Lucene .NET 2.9.4,但我有问题禾:

I'm using AzureDirectory and Lucene .NET 2.9.4 but I have wo problems:


  1. 搜索似乎并不那么快。我使用这些设置索引:
    indexWriter.SetUseCompoundFile(假);
    indexWriter.SetMergeFactor(1000);
    指数约为3.5GB,它有12.126.436文档。
    要创建IndexSearcher的大约需要5分钟以上,即使指数已经在本地磁盘上。是该指数过大?我试图执行两个字段使用MultiFieldQueryParser单个字词的搜索。上田TermVector熄灭

  2. 到处建议仅创建IndexSearcher的实例和查询之间的共享(其实它是缓慢的,以创建),但我不知道如何共享搜索者单(它是执行搜索类)各种Web请求之间。如果我创建的webrole类单身,那我怎么才能使用该实例来进行搜索?此时每个Web请求再现了单。

非常感谢

推荐答案

其实我已经使用了和Lucene.NET与AzureDirectory的确切版本,它不能很好地工作。在我看来,AzureDirectory未对生产规模写的。

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.

如果你看一下源$ C ​​$ c代表AzureDirectory,它是使用:

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


  • 老版本的Lucene作为基础(2.3倍)

  • 异常到处扔满(硬调试/赶生产是正确的)

  • 它使用旧的存储API(pre 1.8版本的SDK)

我结束了创建我自己的专用虚拟机和使用.NET 3.0.3 Lucene.Net库。工作原理是在环境中的冠军,因为我并不需要实现AzureDirectory。

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.

您应该只有一个的IndexWriter,很容易与存储队列来实现。如果你想限制他们写的IndexReader池(如SQL连接池),你可以有多个IndexReaders。我有那些多次运行正常,没有例外飞舞着像他们与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.

这篇关于如何实现在Azure上webrole Lucene的净搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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