Skip to content
This repository has been archived by the owner on Feb 5, 2023. It is now read-only.

How to perform advanced customisation? #151

Closed
vikasaroy opened this issue Mar 4, 2021 · 1 comment
Closed

How to perform advanced customisation? #151

vikasaroy opened this issue Mar 4, 2021 · 1 comment
Labels

Comments

@vikasaroy
Copy link

vikasaroy commented Mar 4, 2021

Hey,

I want to pass geo-location data to the search. Something like below:

use Algolia\AlgoliaSearch\SearchIndex;
use App\Models\Order;

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();

What should we pass in place of SearchIndex?

@stale
Copy link

stale bot commented May 3, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label May 3, 2021
@stale stale bot closed this as completed May 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant