/** * More like this query based on the given object * * The id in the given object has to be set * * @param Elastica_Document $doc Document to query for similar objects * @param array $params OPTIONAL Additional arguments for the query * @param Elastica_Query $query OPTIONAL Query to filter the moreLikeThis results * @return Elastica_ResultSet ResultSet with all results inside * @link http://www.elasticsearch.org/guide/reference/api/more-like-this.html */ public function moreLikeThis(Elastica_Document $doc, $params = array(), $query = array()) { $path = $doc->getId() . '/_mlt'; $query = Elastica_Query::create($query); $response = $this->request($path, Elastica_Request::GET, $query->toArray(), $params); return new Elastica_ResultSet($response); }
/** * More like this query based on the given object * * The id in the given object has to be set * * @param EalsticSearch_Document $doc Document to query for similar objects * @param array $args OPTIONAL Additional arguments for the query * @link http://www.elasticsearch.com/docs/elasticsearch/rest_api/more_like_this/ */ public function moreLikeThis(Elastica_Document $doc, $args = array()) { // TODO: Not tested yet $path = $doc->getId() . '/_mlt'; return $this->request($path, Elastica_Request::GET, $args); }