Skip to content

Call to undefined method ArrayStore::search()  #14

@seivad

Description

@seivad

Hey mate,

Based on the Laravel Scout example, I am using Meilisearch and using a callback function to narrow results down within the controller. For testing I am trying to use your package but it is complaining about the ->search() function you need to return with based on the docs.

Doc example:

Order::search(
    'Star Trek',
    function (SearchIndex $algolia, string $query, array $options) {
        $options['body']['query']['bool']['filter']['geo_distance'] = [
            'distance' => '1000km',
            'location' => ['lat' => 36, 'lon' => 111],
        ];
 
        return $algolia->search($query, $options);
    }
)->get();

and my terminal error Error: Call to undefined method Sti3bas\ScoutArray\ArrayStore::search() in...

I can see you've implemented the search() method which calls performSearch() but so I'm not sure why it can't find that function during the test. Any ideas would be great so I can test these controllers that utilise Scout.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions