Sonny
Sonny

Reputation: 8326

Zend Search Lucene: Where do I put the code?

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?

Upvotes: 0

Views: 153

Answers (1)

Mr Coder
Mr Coder

Reputation: 8186

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

Upvotes: 1

Related Questions