1

Yup, this is a repeat of a question from 7 years ago. The github discussion seems to have died out 2 years ago.

I can't do weird array merging due to pagination which accepts an element query. So it needs to be a single query.

I want a site search that will return entries and Shopify products. I can't be the first person to try doing this.

2 Answers 2

2

The answer is still “no”.

I don’t think the desire to add the feature has died out, even if the GitHub discussion feels somewhat stale. It was on the roadmap not too long ago but I no longer see it there. Why don’t you revive the discussion? It still seems like a much (and long) requested feature that would be very handy to have.

1

I haven't tried this myself, but a potential workaround would be to execute the separate queries (unpaginated), merge them all and then sort by score, and then do pagination afterwards using the create function like this: https://gist.github.com/juban/a55781d49f2f68ec3ca47979bcaaa49a

https://craftcms.com/docs/4.x/dev/functions.html#create

(When encountering this problem myself in the past, so far I've always managed to get away with a (very large) non-paginated result set, grouped by types ("types" might be category groups, entry sections, product groups, or assets etc). Typically I arrange those types visually into tabs - this makes it more obvious that each tab is effectively a new 'relevance context'.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.