如何调用Zend lucene搜索函数?
我继承了一个没有注释的 Zend 项目,而且我没有机会与以前的开发人员交谈。由于我没有 Zend 经验,所以遇到了一些问题:)
我想打印出函数内的一些变量,该函数使用 Zend_Search_Lucene 对站点中的项目进行索引,因为我认为这里出了问题。
据我所知, ::create 创建一个新索引并 ::open 更新它。所以在这个 ::open 函数中我想打印出一些变量。
该函数的名称和参数如下。有谁知道如何调用这个函数以便我可以运行一些测试?
private function search($category,$string,$page = 1,$itemsByPage = 5)
编辑:或者,有没有办法可以破坏现有索引并强制它完全重建,例如删除 FS 上的索引文件,然后执行一些搜索?
I inherited a Zend project devoid of comments and I didn't get to talk to the previous developer. Since I have no Zend experience I'm having some issues :)
I'd like to print out some variables inside an function that indexes items from the site using Zend_Search_Lucene because I think something is going wrong here.
From what I've read, ::create creates a new index and ::open updates it. So it's in this ::open function I'd like to print out some variables.
The name and params of the function are below. Does anyone have any idea how this function can be called so I can run some tests?
private function search($category,$string,$page = 1,$itemsByPage = 5)
EDIT: OR, is there a way I can nuke the existing index and force it to be rebuilt completely, for example by deleting the index files on the FS and then performing some searches?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是一些从头开始创建索引的代码:
...不记得我从哪里得到标准分析器...
Here's some code to create an index from scratch:
... don't remember where i got the standard analyzer from...
很好的例子 -
ZendFramework-1.9.6/demos/Zend/Search/Lucene
ZF 完整发行版
good examples -
ZendFramework-1.9.6/demos/Zend/Search/Lucene
ZF full distro