getgrav / grav-premium-issues

Official Grav Premium Issues repository to report problems or ask questions regarding the Premium products offered.
https://getgrav.org/premium
7 stars 2 forks source link

[algolia-pro] Multiple indexes #342

Closed Sogl closed 1 year ago

Sogl commented 1 year ago

I have two indexes:

How do I simultaneously work with them in instantsearch? Or how can I put both into one index? They have the same structure.

rhukster commented 1 year ago

as far as i now instant search can only search 1 index at a time.

you could create a custom search class that searches pages and then flex objects and stores them in one index. I've not attempted this though, and don't have any example code.

Sogl commented 1 year ago

Tried with Crawl class without success because I use access.site.login: true on most pages.

So I created my class based on PageSearch: https://gist.github.com/Sogl/78dce78b254b39a6678f759b3ff981b7#file-gravflexpagesearch-php

It works fine.