You are here

public function SearchApiElasticsearchViewsHandlerArgumentMoreLikeThis::query in Search API Elasticsearch 7

Set up the query for this argument.

The argument sent may be found at $this->argument.

Overrides SearchApiViewsHandlerArgumentMoreLikeThis::query

File

includes/views/SearchApiElasticsearchViewsHandlerArgumentMoreLikeThis.inc, line 50
Contains SearchApiElasticsearchViewsHandlerArgumentMoreLikeThis.

Class

SearchApiElasticsearchViewsHandlerArgumentMoreLikeThis
@file Contains SearchApiElasticsearchViewsHandlerArgumentMoreLikeThis.

Code

public function query($group_by = FALSE) {
  parent::query($group_by);
  $mlt = $this->query
    ->getOption('search_api_mlt');
  $mlt['min_doc_freq'] = $this->options['min_doc_freq'];
  $mlt['min_term_freq'] = $this->options['min_term_freq'];
  $this->query
    ->getSearchApiQuery()
    ->setOption('search_api_mlt', $mlt);
}