我正在努力解决使用 Zend_Search_Lucene 时遇到的问题/问题。现在我有 2 个索引,我搜索一个解析 html 页面/文本的索引,我使用 Zend_Search_Lucene_Document_Html::loadHTML() 函数读取内容并添加到 lucene 索引之一。
另一个索引我使用 Zend_Search_Lucene_Document() 函数手动创建一个 lucene 文档,将文本和关键字字段添加到文档中。
将数据添加到我的索引的两种方法都有效,并且使用 Luke(很棒的工具)查看索引我可以看到两个索引中的不同文档,我可以使用 Luke 编写返回结果的手动查询。
我目前在搜索包含手动创建的文档的索引时遇到错误。使用框架中提供的查询 API 构建查询时,我得到了我期望的结果数量,但是当我尝试从此搜索命中获取“文档”时,没有返回任何内容。
我收到以下错误
Warning: fseek(): supplied argument is not a valid stream resource in C:\www\mysite\development\website\library\Zend\Search\Lucene\Storage\File\Filesystem.php on line 93
Warning: fread(): supplied argument is not a valid stream resource in C:\www\mysite\development\website\library\Zend\Search\Lucene\Storage\File\Filesystem.php on line 158
Warning: flock() expects parameter 1 to be resource, integer given in C:\www\mysite\development\website\library\Zend\Search\Lucene\Storage\File\Filesystem.php on line 214
Uncaught exception 'Zend_Search_Lucene_Exception' with message 'Field name "itemname" not found in document.'
如果我使用 HTML 内容和查询 API 对索引运行搜索,我会得到包含文档的结果,我可以从中获取一些文档数据。
对于这两个查询,我使用 Zend_Search_Lucene_Search_QueryParser::parse() 函数和一些添加的子查询来生成搜索查询。
是否有任何已知问题,为什么在解析文档时我的搜索运行良好,但我创建的文档上的搜索失败并显示上述错误消息?
非常感谢,
授予