Smile\ElasticsuiteCore\Api\Search\Spellchecker\RequestInterface::getCutoffFrequency PHP 메소드

getCutoffFrequency() 공개 메소드

Spellcheck cutoff frequency (used to detect stopwords).
public getCutoffFrequency ( ) : float
리턴 float
    public function getCutoffFrequency();

Usage Example

예제 #1
0
 /**
  * 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).
  *
  * @param RequestInterface $request The spellcheck request.
  *
  * @return int
  */
 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;
 }