You are here

public function SearchApiSolrAcquiaConnector::getMoreLikeThisQuery in Acquia Search 3.x

Same name and namespace in other branches
  1. 2.x src/Plugin/SolrConnector/SearchApiSolrAcquiaConnector.php \Drupal\acquia_search\Plugin\SolrConnector\SearchApiSolrAcquiaConnector::getMoreLikeThisQuery()

Creates a new Solarium more like this query.

Return value

\Solarium\QueryType\MorelikeThis\Query The MoreLikeThis query.

Overrides SolrConnectorPluginBase::getMoreLikeThisQuery

File

src/Plugin/SolrConnector/SearchApiSolrAcquiaConnector.php, line 429

Class

SearchApiSolrAcquiaConnector
Class SearchApiSolrAcquiaConnector.

Namespace

Drupal\acquia_search\Plugin\SolrConnector

Code

public function getMoreLikeThisQuery() {
  $this
    ->connect();
  $query = $this->solr
    ->createMoreLikeThis();
  $query
    ->setHandler('mlt');
  $query
    ->addParam('qt', 'mlt');
  return $query;
}