jikan-me / jikan-rest

The REST API for Jikan
https://docs.api.jikan.moe/
MIT License
427 stars 270 forks source link

🐛 [HOSTED-RR] Generated Issue: ObjectNotFound #554

Open sawa-ko opened 5 days ago

sawa-ko commented 5 days ago

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 `popularity` in the schema for sorting. Trace: /app/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/anime?q=pekora

Environment

- OS: Ubuntu 24.04.1 LTS
- Browser: Google Chrome Versión 129.0.6668.89
- Docker image: jikanme/jikan-rest:latest

Anything else?

image

pushrbx commented 5 days ago

Hi @sawa-ko, You see this error when you have nothing in the search index or there are missing collections because you haven't loaded enough data yet.

Please refer to the following lines for the correct artisan commands to update the index: https://github.com/jikan-me/jikan-rest/blob/master/container-setup.sh#L158-L169 Note that this can take 4-5 days to finish.

Alternatively you can use the "scout" artisan commands to drop and reload the search index, given if you have data in your mongodb instance:

php artisan scout:delete-all-indexes
php artisan scout:import App\Anime
php artisan scout:import App\Manga
php artisan scout:import App\Person
php artisan scout:import App\Character
php artisan scout:import App\GenreAnime
php artisan scout:import App\GenreManga
php artisan scout:import App\Magazine
php artisan scout:import App\Producers
php artisan scout:import App\Character
php artisan scout:import App\Profile
php artisan scout:import App\Club

Enter in the container with docker exec -it <container name> /bin/bash or podman exec -it <container name> /bin/bash, and execute the above commands one by one.

pushrbx commented 5 days ago

fyi we have an issue for changing this error message: https://github.com/jikan-me/jikan-rest/issues/478

pushrbx commented 5 days ago

Related issue: https://github.com/jikan-me/jikan-rest/issues/477