
Это запрос, который выдает ошибку
Код: Выделить всё
$result = Todo::search('test')->get();
Код: Выделить всё
public function toSearchableArray()
{
return array_merge(
$this->toArray(),
[
// Cast id to string and turn created_at into an int32 timestamp
// in order to maintain compatibility with the Typesense index definition below
'id' => (string) $this->id,
'created_at' => $this->created_at->timestamp,
]
);
}
/**
* The Typesense schema to be created.
*
* @return array
*/
public function getCollectionSchema(): array {
return [
'name' => $this->searchableAs(),
'fields' => [
[
'name' => 'id',
'type' => 'string',
],
[
'name' => 'title',
'type' => 'string',
],
[
'name' => 'created_at',
'type' => 'int64',
],
],
'default_sorting_field' => 'created_at',
];
}
/**
* The fields to be queried against. See https://typesense.org/docs/0.24.0/api/search.html.
*
* @return array
*/
public function typesenseQueryBy(): array {
return [
'id','title'
];
}
Код: Выделить всё
#message: "Method Laravel\Scout\Builder::getCollection does not exist."
Подробнее здесь: https://stackoverflow.com/questions/776 ... eins-error
Мобильная версия