website icon indicating copy to clipboard operation
website copied to clipboard

Paginate Algolia search results

Open dholbach opened this issue 2 years ago • 5 comments

It would be great if we could show more than 5 search results. https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/pagination/js/ seems to describe how it's done.

dholbach avatar Oct 12 '22 06:10 dholbach

@hiddeco found https://www.algolia.com/doc/guides/building-search-ui/ui-and-ux-patterns/infinite-scroll/js/ as a probably better suggestion.

dholbach avatar Oct 12 '22 08:10 dholbach

@dholbach is there some metadata that we can add in the markdown for Angolia to prioritise some pages based on keywords? For example we would like for FAQ to have the FAQ page as the first result, for OCI the OCI cheatsheet, for bootstrap the bootstrap cheatsheet and so on.

stefanprodan avatar Oct 12 '22 08:10 stefanprodan

Another issue is that Angolia prioritises the generated API docs instead of the one written for end-users, which is less than ideal. I personally stopped using the search due to this. I think I've proposed this before, @hiddeco would you agree to remove the generated API spec from search and main menu?

stefanprodan avatar Oct 12 '22 08:10 stefanprodan

docsearch is what we are using in https://github.com/fluxcd/website/blob/main/layouts/partials/hooks/body-end.html

Unfortunately it's not supported there yet: https://github.com/algolia/docsearch/issues/883

So Hidde's example in the earlier comment could be helpful. If anyone could help with that, that'd be great.

dholbach avatar Oct 24 '22 15:10 dholbach

Regarding pagination: docusaurus seems to do this better than docsy, but I couldn't find how it's configured there.

Check out the https://docs.gitops.weave.works/ search as an example.

dholbach avatar Dec 12 '22 17:12 dholbach