Add moreLikeThis query to finder
This commit is contained in:
parent
ab0c27c481
commit
79501dc319
1 changed files with 16 additions and 0 deletions
|
|
@ -45,6 +45,22 @@ class TransformedFinder implements PaginatedFinderInterface
|
|||
return $this->transformer->hybridTransform($results);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find documents similar to one with passed id.
|
||||
*
|
||||
* @param integer $id
|
||||
* @param array $params
|
||||
* @param array $query
|
||||
* @return array of model objects
|
||||
**/
|
||||
public function moreLikeThis($id, $params = array(), $query = array())
|
||||
{
|
||||
$doc = new Document($id);
|
||||
$results = $this->searchable->moreLikeThis($doc, $params, $query)->getResults();
|
||||
|
||||
return $this->transformer->transform($results);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $query
|
||||
* @param null|int $limit
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue