我有一个要添加站点搜索功能的 CMS。该应用程序使用完整的 Zend Framework MVC 堆栈。
在这一点上,我似乎应该创建/使用搜索模型。到目前为止,我创建的所有模型都基于数据库表。搜索模型会是什么样子?我采取了错误的方法吗?
我有一个要添加站点搜索功能的 CMS。该应用程序使用完整的 Zend Framework MVC 堆栈。
在这一点上,我似乎应该创建/使用搜索模型。到目前为止,我创建的所有模型都基于数据库表。搜索模型会是什么样子?我采取了错误的方法吗?
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