Zend Search Lucene:我把代码放在哪里?
我有一个 CMS,正在添加站点搜索功能。该应用程序使用完整的 Zend Framework MVC 堆栈。
此时,我似乎应该创建/使用搜索模型。到目前为止我创建的所有模型都是基于数据库表的。搜索模型会是什么样子?我采取了错误的方法吗?
I have a CMS that I am adding Site Search functionality. The application uses the full Zend Framework MVC stack.
At this point if seems that I should be creating/using a Search model. All models I've created up to this point have been based on database tables. What would a Search model look like? Am I taking the wrong approach?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
基本上,通过使用 Zend_Search_Lucne,您将在 Web 服务器上创建数据库索引。因此,将负载从数据库服务器转移到 Web 服务器(这是一件好事,因为您可以轻松拥有许多 Web 服务器,但没有很多数据库服务器)。
建立索引。您将表中希望可搜索的每一行视为 lucene 中的单个 Zend_Search_Lucene_Document 。列变成了 Zend_Search_Lucene_Field 。您将这些文档添加到位于硬盘上的索引中。在搜索时,您会针对该索引进行查询。
要了解更多信息 http://framework.zend.com/手册/en/zend.search.lucene.index-creation.html
Basically by using Zend_Search_Lucne you will create an index of your database on to your web-server . Hence shifting load from database server to web-server (which is good thing since you can easily have many webserver but not many database server).
To build index . You treat each row of your table which you want to be searchable as a single Zend_Search_Lucene_Document in lucene . And columns becames Zend_Search_Lucene_Field . You add these documents into your index which lives on hardisk . At the time of searching you query against this index .
To know more http://framework.zend.com/manual/en/zend.search.lucene.index-creation.html