how to create a search functionality like the the one in this page :
http://news.maktoob.com/search?q=%D8%AE%D8%A8%D8%B1&type=site
it开发者_如何学Go searchs the database for the exact occurrence for the search text
and display the part of the content that contains this search text
I suggest you use a search framework like lucene to perform the search and the term highlighting in the found documents for you.
This article should get you started: http://ganeshhs.com/zend-framework/zend-search-lucene-part4-search-results-highlighting
精彩评论