Merge pull request #355 from richardmiller/add-mlt
Add moreLikeThis query to finder
This commit is contained in:
commit
f97dc21030
|
@ -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…
Reference in a new issue