laravel / scout

Laravel Scout provides a driver based solution to searching your Eloquent models.
https://laravel.com/docs/scout
MIT License
1.54k stars 327 forks source link

Implement `updateIndexSettings` for algolia search #829

Closed yueyuzhao closed 3 months ago

yueyuzhao commented 3 months ago

For now only MeilisearchEngine implements updateIndexSettings, but algolia also support index setting, see https://www.algolia.com/doc/api-reference/api-methods/set-settings/.

driesvints commented 3 months ago

I see you made a PR so let's see how it goes. Thanks

yueyuzhao commented 3 months ago

Since the PR for this feature is closed, for those who might need this can:

  1. create a custom search engine with method updateIndexSettings and extends AlgoliaEngine
    
    <?php
    namespace App;

use Laravel\Scout\Engines\AlgoliaEngine;

class AlgoliaSearchEngine extends AlgoliaEngine { /**

namespace App\Providers;

use Algolia\AlgoliaSearch\SearchClient as Algolia; use Algolia\AlgoliaSearch\Config\SearchConfig; use Algolia\AlgoliaSearch\Support\UserAgent; use App\AlgoliaSearchEngine; use Illuminate\Support\ServiceProvider; use Laravel\Scout\EngineManager; use Laravel\Scout\Scout;

class AlgoliaServiceProvider extends ServiceProvider { /**