Ваш контроллер должен выглядеть так:
$this->load->library('pagination');
$query_result = $index->find($query);
$offset = $this->uri->segment(3,0);
$limit = 10;
// this is the cool part, which you don't know
$set= array();
for($i=$offset; $i< $limit + $offset; $i++)
{
if(array_key_exists($i, $query_result)){
$set[]= $query_result[$i];
}else{
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'] = $limit;
$config['num_links'] =10;
$this->pagination->initialize($config);
$data['links'] = $this->pagination->create_links();
$data['results'] = $set;// pass the paginated resulted to the view
$this->load->view('myview',$data);
И ваш взгляд должен выглядеть так
<?php foreach($results as $result):?>
<?=$result->title?>
<?=$result->detail?>
<?=$result->post_date?>
<?php endforeach;?>
<?=$links?>//the pagination links