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

Add book and chapter title in the response of /api/search/ endpoint #5140

Closed
adimesic opened this issue Jul 23, 2024 · 1 comment
Closed

Comments

@adimesic
Copy link

API Endpoint or Feature

Is it possible to add the book and chapter title in the response of the /api/search endpoint? Right now, the response only shows the book_id and chapter_id if the type value is a page.

As a workaround, I loop through the response of /api/search and hit the /api/books/{id} endpoint every time to get the book title. The same for chapters also. I need to hit the /api/chapters/{id} endpoint to get the chapter title.

Use-Case

I use the api/search endpoint for an external site to access a KB (knowledge Base) that is using BookStack. Both the external site and my instance of BookStack are not publicly available. As I mentioned earlier, as a workaround I need to loop trough the response of the /api/search endpoint to fetch the book and chapter titles from the API so that the external site can consume my custom endpoint with all the necessary data. It is slow and very tedious, so the inclusion of the book and chapter titles in the search response would be great.

Additional context

I don't know if the inclusion of the book and chapter title would be a performance hit, but I assume it could be an optional parameter (or flag) set in the /api/search endpoint. Lets say a query parameter that would indicate to include the title of the book and chapter in the response.

@ssddanbrown
Copy link
Member

Thanks to @rashadkhan359 for starting it off in #5280, this has now been added and will be part of the next feature release.
Thanks @adimesic for the original request.

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

No branches or pull requests

2 participants