laravelmeilisearch

Laravel/Meilisearch - Did you forget to add \"http(s)://\"?


I'm currently trying to get my website up and running with Laravel Forge.

And while everything works fine on my local, I've run into an error on my production website.

Just about any POST request I try using models that have the "Searchable" trait will return an error like this:

[2022-11-16 06:06:49] production.ERROR: Invalid URL: scheme is missing in "/indexes/comments/documents/delete-batch". Did you forget to add "http(s)://"? {"userId":1,"exception":"[object]

It will always bring up something along the lines of "Invalid URL: scheme" and :Did you forget to add "http(s)://"?".

I notice that in all of these logs there seems to be something going on with "MeiliSearchEngine".

Has anyone else had a similar problem?

If I had to guess, this is error is being probably caused when meilisearch is attempting to index these new Searchable models.

Here is my scout config

return [

    'driver' => env('SCOUT_DRIVER', 'algolia'),

    'prefix' => env('SCOUT_PREFIX', ''),

    'queue' => env('SCOUT_QUEUE', false),

    'after_commit' => false,

    'chunk' => [
        'searchable' => 500,
        'unsearchable' => 500,
    ],

    'soft_delete' => false,

    'identify' => env('SCOUT_IDENTIFY', false),

    'algolia' => [
        'id' => env('ALGOLIA_APP_ID', ''),
        'secret' => env('ALGOLIA_SECRET', ''),
    ],
    
    'meilisearch' => [
        'host' => env('MEILISEARCH_HOST', 'http://127.0.0.1:7700'),
        'key' => env('MEILISEARCH_KEY', null),
        'settings' => [
            \App\Submission::class => [
                'updateFilterableAttributes'=> ['nsfw',],
            ],      
        ],  
    ],
];

Solution

  • I had duplicate SCOUT_DRIVER variables in my .env file.