class Post
{
public $implement = ['Shohabbos.Elasticsearch.Classes.Searchable'];
// optional
// public $useSearchIndex = 'index';
// optional
// public $useSearchType = 'type';
// optional
// You can specify the fields to be indexed.
// public function toSearchArray() {
// return [
// 'title' => $this->title
// ];
// }
}
$result = Post::elasticsearch()->find(10);
// @var $result Collection
$result = Post::elasticsearch()
->select(['title', 'content'])
->orderBy("created_at")
//->orderByDesc('created_at')
->limit(10)
->where(['content_html' => 'the'])
//->whereIn('something', ['title^5', 'content'])
//->rawQuery(['match' => ['field' => 'abs']])
//->dumpParams()
->get();