Smile\ElasticsuiteCore\Search\Adapter\Elasticsuite\Spellchecker::getCutoffrequencyLimit PHP Method

getCutoffrequencyLimit() private method

Count document into the index and then multiply it by the request cutoff frequency to compute an absolute cutoff frequency limit (max numbre of doc).
private getCutoffrequencyLimit ( Smile\ElasticsuiteCore\Api\Search\Spellchecker\RequestInterface $request ) : integer
$request Smile\ElasticsuiteCore\Api\Search\Spellchecker\RequestInterface The spellcheck request.
return integer
    private function getCutoffrequencyLimit(RequestInterface $request)
    {
        $indexStatsResponse = $this->client->indices()->stats(['index' => $request->getIndex()]);
        $indexStats = current($indexStatsResponse['indices']);
        $totalIndexedDocs = $indexStats['total']['docs']['count'];
        return $request->getCutoffFrequency() * $totalIndexedDocs;
    }