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?

有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top