Anyone, I try to integrate the Zend Lucene search system with codeigniter but the problem is how do I Codeigniter can align the search result
The search code below is:
$ query // to search the keyword $ index = Zend_Search_Lucene: Open (Documentary 'Data / index'); // index index $ hit ['post'] = $ index- & gt; Search ($ query); // search results please help me
Your administrator should look like this:
$ this-> Load-> Library ('pagination'); $ Query_result = $ index- & gt; Search ($ query); $ Offset = $ it- & gt; Yuri- & gt; Segment (3,0); $ Range = 10; // This is a good part, which you do not know $ set = array (); ($ I = $ offset; $ i & lt; $ limit + $ offset; $ i ++) {if (array_key_exists ($ i, $ query_result)) {$ set [] = $ query_result [$ i]; } And {break} }} End of cool part / $ config ['base_url'] = base_url (). 'Search / index /'; $ Config ['total_rows'] = Count ($ query_result); $ Config ['uri_segment'] = 3; $ Config ['per_page'] = $ border; $ Config ['num_links'] = 10; $ This- & gt; Pagination-> Start ($ config); $ Data ['link'] = $ this- & gt; Endorsement-> Create_links (); $ Data ['result'] = $ set; // Seeing Directions Passed as a result of $$ - this- & gt; Load-> View ('MyView', $ data); and your view should look like
& lt; Php foreach ($ result as result result):? & Gt; & Lt ;? = $ Result-> Title & gt; & Lt ;? = $ Result-> & Gt; & Lt ;? = $ Result-> POST_DATE & gt; & Lt ;? Php endforeach ;? & Gt; & Lt ;? = $ Links? & Gt; // pagination link
Comments
Post a Comment