一起使用 Solr 和 Zends Lucene 端口

发布于 2024-08-29 02:12:31 字数 657 浏览 8 评论 0原文

下午的朋友们,

在我使用 Zend-Lucene-Search 进行冒险之后,发现它在索引大型数据集时并不像人们所吹嘘的那样,我转向了 Solr(感谢 Bill Karwin :))

我已经得到了Solr 现在对数据库进行索引的速度要快得多,只需要 8 分钟多一点就可以对包含超过 170 万行的表建立索引 - 我对此非常满意。

但是,当我尝试使用 Zend 端口搜索索引时,遇到以下错误;

致命错误:在 /var/www/Zend/Search/Lucene.php 中未捕获异常“Zend_Search_Lucene_Exception”,并带有消息“不支持的段文件格式”:407 堆栈跟踪:#0 /var/www/Zend/Search/Lucene.php(555 ): Zend_Search_Lucene->_readSegmentsFile() #1 /var/www/z_search.php(12): Zend_Search_Lucene->__construct('tmp/feeds_index') #2 {main} 抛出在 /var/www/Zend/Search 中/Lucene.php on line 407

我尝试进行搜索,但似乎找不到有关此问题的任何信息,每个人似乎都能让它们工作?

一如既往地感谢任何帮助:)

谢谢,

汤姆

Afternoon chaps,

After my adventures with Zend-Lucene-Search, and discovering it isn't all its cracked up to be when indexing large datasets, I've turned to Solr (thanks to Bill Karwin for that :) )

I've got Solr indexing the db far far quicker now, taking just over 8 minutes to index a table of just over 1.7million rows - which I'm very pleased with.

However, when I come to try and search the index with the Zend port, I run into the following error;

Fatal error: Uncaught exception 'Zend_Search_Lucene_Exception' with message 'Unsupported segments file format' in /var/www/Zend/Search/Lucene.php:407 Stack trace: #0 /var/www/Zend/Search/Lucene.php(555): Zend_Search_Lucene->_readSegmentsFile() #1 /var/www/z_search.php(12): Zend_Search_Lucene->__construct('tmp/feeds_index') #2 {main} thrown in /var/www/Zend/Search/Lucene.php on line 407

I've tried to have a search around but can't seem to find anything about this problem, everyone just seems to be able to get them to work?

Any help as always much appreciated :)

Thanks,

Tom

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

余生一个溪 2024-09-05 02:12:31

我在我的机器上确认Zend_Search_Lucene无法读取通过Solr创建的Lucene索引。

当 Zend_Search_Lucene 检测到它不支持的 Lucene 索引格式时,它会抛出该异常。查看代码,Zend 目前支持 2.1、2.1 和 2.3 之前的格式。

Solr 以 FORMAT_HAS_PROX 格式创建索引,据我所知,Lucene 2.9 及更高版本使用该格式。

I confirmed on my machine that a Lucene index created through Solr cannot be read by Zend_Search_Lucene.

Zend_Search_Lucene throws that exception when it detects a Lucene index format that it doesn't support. Looking at the code, Zend currently supports formats pre-2.1, 2.1, and 2.3.

Solr creates an index in format FORMAT_HAS_PROX which as far as I can tell is used by Lucene 2.9 and higher.

∞琼窗梦回ˉ 2024-09-05 02:12:31

以前从未使用过 Zend,但我使用过 Lucene/Solr。

您是否为 Solr 索引和 Zend 端口使用相同版本的 Lucene?检查每个文件使用的 Lucene jar 文件。如果它们不同,则 Solr 可能会生成与 Zend 端口不兼容的 Lucene 索引。

Never used Zend before, but I've used Lucene/Solr.

Are you using the same version of Lucene for both the Solr indexing and the Zend port? Check to see what Lucene jar file is being used for each. If they're different, then Solr might be producing a Lucene index that isn't compatible with the Zend port.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文