Global search doesn't work with Algolia when using the algolia/scout-extended
package
#3719
bakerkretzmar
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description:
Algolia maintains the
algolia/scout-extended
package which adds additional functionality to Laravel Scout, and it overrides a bunch of Scout's methods to handle things like aggregates, differently formatted object IDs, etc. It overrides Scout's AlgoliaEngine'smap()
method, but not thelazyMap()
method, which is what Nova's usage of Scout ends up calling (from inside thecursor
method inLaravel\Nova\Query\Builder
).lazyMap
does not play nicely with Scout Extended and just always returns an empty set of results.I think this is more of a Scout Extended problem than a Nova problem, but I wanted to mention it as the package is quite popular. I think it would be quite straightforward for Nova to work around this issue by checking if the query builder is from Scout Extended, perhaps like this:
I worked around this in my app by binding my own extension of the query builder and overriding that method to just remove the
cursor
method check.See algolia/scout-extended#298.
Beta Was this translation helpful? Give feedback.
All reactions