zencart / documentation

Zen Cart FAQs and Developer Documentation
https://docs.zen-cart.com
MIT License
7 stars 27 forks source link

Upgrade Algolia DocSearch #1119

Closed simon1066 closed 10 months ago

simon1066 commented 10 months ago

The Docs currently use version 2 of DocSearch and I believe it would benefit from a upgrade to version 3.

https://docsearch.algolia.com/docs/docsearch-v3/ - top right on that page is a working v3 search box. Investigations show that changes are needed to the following files:

\layouts\partials\hooks\body-end.html \layouts\partials\hooks\head-end.html \layouts\partials\search-input.html

there may be more depending on what fine-tuning is required.

I have not been able to fully test it on ZC Docs as the new configuration requires the appId, which I do not have.

https://docsearch.algolia.com/docs/migrating-from-v2/

I would be happy to progress this further if need be.

scottcwilson commented 10 months ago

@drbyte Can you provide this information?

drbyte commented 10 months ago

I'll dig them up. But in the meantime, does it work to use the Testing credentials Algolia offers? https://docsearch.algolia.com/docs/docsearch-v3/#testing

simon1066 commented 10 months ago

Yes, I have used the test credentials but that causes the search results to reference https://docsearch.algolia.com

4

drbyte commented 10 months ago

Does our implementation also need an api Key for the frontend?

simon1066 commented 10 months ago

I was using the same apiKey (and indexName) as in \layouts\partials\hooks\body-end.html but this generates no search results and a console error of

Invalid Application-ID or API key

so it's possible that we'll need a different apiKey.

simon1066 commented 10 months ago

Thank you, that did it. I'll see if anything needs tweaking and submit a PR.