You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation of the method PerformsQueries::initializeQueryUsingScout assumes that the method Searchable::getScoutKey always returns getKey. So when you run scout:import, normally, objectID at Algolia will be 1, 2, etc.
The problem is Searchable::getScoutKey method can be actually override by the developer, returning something else, like App\Model::1. Each leads to a search with no results.
The solution is get models instances from the scout search, and using the getKey to get models keys:
nunomaduro
changed the title
Issue with initializeQueryUsingScout implementation
Laravel Scout issue in initializeQueryUsingScout implementation
Jan 7, 2019
Description:
The current implementation of the method
PerformsQueries::initializeQueryUsingScout
assumes that the methodSearchable::getScoutKey
always returnsgetKey
. So when you runscout:import
, normally,objectID
at Algolia will be1
,2
, etc.The problem is
Searchable::getScoutKey
method can be actually override by the developer, returning something else, likeApp\Model::1
. Each leads to a search with no results.The solution is get models instances from the scout search, and using the
getKey
to get models keys:The text was updated successfully, but these errors were encountered: