mirror of
https://github.com/jikan-me/jikan-rest.git
synced 2025-02-20 11:23:35 +08:00
fixed indexing issue with typesense
- all models have a "title" field, and that's the default sorting field, however this is not being indexed as such for the models, except where explicitly specified (Anime and Manga models)
This commit is contained in:
parent
289bdfb368
commit
8d4a595b75
@ -21,12 +21,20 @@ abstract class JikanApiSearchableModel extends JikanApiModel implements Typesens
|
||||
*/
|
||||
public function getCollectionSchema(): array
|
||||
{
|
||||
$titleAttributeName = $this->getTitleAttributeName();
|
||||
|
||||
return [
|
||||
'name' => $this->searchableAs(),
|
||||
'fields' => [
|
||||
[
|
||||
'name' => '.*',
|
||||
'type' => 'auto',
|
||||
],
|
||||
[
|
||||
'name' => $titleAttributeName,
|
||||
'type' => 'string',
|
||||
'sort' => true,
|
||||
'optional' => false
|
||||
]
|
||||
]
|
||||
];
|
||||
|
Loading…
x
Reference in New Issue
Block a user