Skip to content

Commit

Permalink
added typesense collection schema for Magazine model
Browse files Browse the repository at this point in the history
  • Loading branch information
pushrbx authored Nov 8, 2024
1 parent 9553c2e commit 2272ed1
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions app/Magazine.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,33 @@ public function toSearchableArray(): array
];
}

public function getCollectionSchema(): array
{
return [
'name' => $this->searchableAs(),
'fields' => [
[
'name' => '.*',
'type' => 'auto',
],
[
'name' => 'titles',
'type' => 'string',
'optional' => false,
'infix' => true,
'sort' => true
],
[
'name' => 'url',
'type' => 'string',
'optional' => false,
'infix' => true,
'sort' => true
],
]
];
}

public function typesenseQueryBy(): array
{
return [
Expand Down

0 comments on commit 2272ed1

Please sign in to comment.