本文介绍了一起使用 Solr 和 Zends Lucene 端口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下午的聚会,

在我使用 Zend-Lucene-Search 进行冒险之后,发现它在索引大型数据集时并非完全如此,我转向了 Solr(感谢 Bill Karwin :))

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 :) )

我现在让 Solr 更快地为数据库建立索引,只用了 8 多分钟就可以索引一个刚刚超过 170 万行的表——我对此感到非常满意.

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.

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

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

致命错误:在/var/www/Zend/Search/Lucene.php:407 堆栈跟踪:#0/var/www/Zend/Search/Lucene 中带有消息不支持的段文件格式"的未捕获异常Zend_Search_Lucene_Exception".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/在第 407 行搜索/Lucene.php

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 :)

谢谢,

汤姆

推荐答案

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

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

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

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 以 FORMAT_HAS_PROX 格式创建索引,据我所知,Lucene 2.9 及更高版本使用该索引.

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

这篇关于一起使用 Solr 和 Zends Lucene 端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 08:32