4 && ($number % 100) < 20) ? 2 : $cases[min($number % 10, 5)]]; } // Init config $config = json_decode( file_get_contents( __DIR__ . '/../../config.json' ) ); // Init $client = new \Manticoresearch\Client( [ 'host' => $config->manticore->server->host, 'port' => $config->manticore->server->port, ] ); // Init index $index = $client->index( $config->manticore->index->document ); // Get totals $total = $index->search('') ->option('cutoff', 0) ->limit(0) ->get() ->getTotal(); $placeholder = plural( $total, [ sprintf( _('Over %s page or enter the new one...'), number_format( $total ) ), sprintf( _('Over %s pages or enter the new one...'), number_format( $total ) ), sprintf( _('Over %s pages or enter the new one...'), number_format( $total ) ), ] ); // Request $q = !empty($_GET['q']) ? $_GET['q'] : ''; $p = !empty($_GET['p']) ? (int) $_GET['p'] : 1; // Check URL for exist $results = $index->search($q) ->offset($p * $config->webui->pagination->limit - $config->webui->pagination->limit) ->limit($config->webui->pagination->limit) ->get(); ?>