Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 [HOSTED] Generated Issue: ObjectNotFound #477

Open
1 task done
itsTKRaz opened this issue Jan 23, 2024 · 4 comments
Open
1 task done

馃悰 [HOSTED] Generated Issue: ObjectNotFound #477

itsTKRaz opened this issue Jan 23, 2024 · 4 comments
Labels

Comments

@itsTKRaz
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

The API has returned an error:
Typesense\Exceptions\ObjectNotFound
Status code: 0
Message: Could not find a field named `rank` in the schema for sorting.
Trace: /var/www/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=Elfen+Lied&page=1

Environment

OS: Latest Debian LTS
PHP: 8.2.6
Jikan Rest: Latest (pulled today)

Anything else?

N/A

@pushrbx
Copy link
Collaborator

pushrbx commented Jan 23, 2024

@itsTKRaz you need to run the indexer first, so you would have data in typesense.
I'm going to create a new issue to let people know if this error happens.

@pushrbx
Copy link
Collaborator

pushrbx commented Jan 23, 2024

I've created a new issue to address this: #478

@itsTKRaz
Copy link
Author

@itsTKRaz you need to run the indexer first, so you would have data in typesense. I'm going to create a new issue to let people know if this error happens.

I feel like a lot of the documentation is unclear in regards to this, which made no mention of running the indexer. And some of the links in the wiki give 404 errors.

To fill the data in typesense and, is this the required command to run, just to clarify? php artisan indexer:anime or are there other recommended commands to run to get started correctly that I'm missing?

@pushrbx
Copy link
Collaborator

pushrbx commented Jan 26, 2024

I've already answered somewhat on discord: https://discord.com/channels/460491088004907029/1200149578406703236/1200235685727195166

Just to elaborate a bit more, and to make a note for myself of "missing things from docs":

  • The wiki is not maintained.
  • The commands are mentioned here: https://github.com/jikan-me/jikan-rest/blob/master/COMMANDS.MD -- but no docs outside of the wiki mention it.
  • The items being indexed once they are loaded to mongodb, which happens when new data is scraped from MAL, which happens when an item you request for through "/v4/anime/" doesn't exist yet in mongodb. So running the indexer via "php artisan indexer:anime" also loads the data in typesense.
  • You need to run "php artisan indexer:..." commands in a seperate container or locally without container, while a jikan api container is running, because the indexer sends http requests to the running jikan api app.
  • You need to run all these commands to have a fully populated mongodb/typesense: https://github.com/jikan-me/jikan-rest/blob/master/container-setup.sh#L159-L169
    Which is in non docker syntax is the following:
php artisan indexer:anime
php artisan indexer:manga
php artisan indexer:common
php artisan indexer:genres
php artisan indexer:producers

Note: You can make it fetch the latest with the "--reverse" command line option.
Also please note that sometimes the php artisan indexer:anime-sweep and php artisan indexer:manga-sweep commands needs to be ran to remove removed items from mongodb. By removed items I mean items removed on MAL side.

  • The container image already runs a "supercronic" process which runs the update of the items. This seems to be broken at the moment (all versions of the container image). I just noticed this on my self hosted instance, and I'm planning to investigate it. (needs an issue)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants