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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow api search to filter by book_id and chapter_id #5402

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

helderjsm
Copy link

@helderjsm helderjsm commented Jan 10, 2025

In Api we should be able to search by book_id and or chapter_id to reduce the set of results.

Example search using book_id filtering:
http://localhost:6875/api/search?count=100&page=1&query=p{type:page}{book_id:5}
Example search using chapter_id filtering:
http://localhost:6875/api/search?count=100&page=1&query=p{type:page}{chapter_id:2}

@helderjsm helderjsm changed the title Allow search to filter by book_id and chapter_id Allow api search to filter by book_id and chapter_id Jan 10, 2025
@ssddanbrown
Copy link
Member

Thanks for offering this PR @helderjsm.
Happy for such a feature to be implemented since it meets my main criteria for API additions (mirrors what we provide in the UI, and we provide chapter/book specific search).

I'm not too sure about adding them via filters though.
I think the use is fundamental enough for them to be considered as their own API endpoints.
So /api/search/book/{id}//api/search/chapter/{id}.
This way the type filtering can be hard-coded/limited instead of causing confusion in the need to apply them.

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

Successfully merging this pull request may close these issues.

2 participants