Closed AinsAlmeyn closed 5 months ago
I had this issue before. To resolve it, you would basically have to wipe your Jikan Database and begin indexing entirely from the beginning with Typesense enabled from the beginning.
To index you run in the server console: php artisan indexer:anime
and let it run. Will take a day and a half.
After that's done, run: php artisan scout:import "App\Anime"
You need to let the indexer run in it's entirely from the start with Typesense enabled before doing anything. You won't get certain characters and anime to query until the indexer is completed using the commands noted above.
@itsTKRaz Thanks for sharing. This is happening on the public api, it's not a self hosted issue. If you self host the issue creation link under error messages have different parameters which will set a different title for the issue.
@irfan-dahir You need to flush the "characters" collection in typesense, and load everything again. :monkey:
@pushrbx I've run
php artisan scout:flush "App\Character"
php artisan scout:import "App\Character"
However the issue persists. Please advise 😄
@pushrbx I've run
php artisan scout:flush "App\Character" php artisan scout:import "App\Character"
However the issue persists. Please advise 😄
I'll message you on discord
I've found the issue: the Character model (and others too) should explicitly set the fields with sort index for typesense.
Is there an existing issue for this?
Current Behavior
The API has returned an error:
Typesense\Exceptions\ObjectNotFound
Status code:0
Message:Could not find a field named `name` in the schema for sorting.
Trace:/var/www/jikan-rest/vendor/typesense/typesense-php/src/ApiCall.php on line 348
Expected Behavior
The API should have returned a successful response with data.
Steps To Reproduce
Http Request: `GET /v4/characters?q=momonga&order_by=name&sort=desc
Environment
No response
Anything else?
No response