Elastica\Query\MoreLikeThis::setLike PHP Method

setLike() public method

Set the "like" value.
public setLike ( string | Document $like )
$like string | Elastica\Document
    public function setLike($like)
    {
        return $this->setParam('like', $like);
    }

Usage Example

 /**
  * @group unit
  */
 public function testToArrayForSource()
 {
     $query = new MoreLikeThis();
     $query->setLike(new Document('', array('Foo' => 'Bar'), 'type', 'index'));
     $data = $query->toArray();
     $this->assertEquals(array('more_like_this' => array('like' => array('_type' => 'type', '_index' => 'index', 'doc' => array('Foo' => 'Bar')))), $data);
 }
All Usage Examples Of Elastica\Query\MoreLikeThis::setLike