meilisearch / meilisearch-php

PHP wrapper for the Meilisearch API
https://meilisearch.com
MIT License
610 stars 97 forks source link

Laravel Scout - empty results #381

Closed francoism90 closed 2 years ago

francoism90 commented 2 years ago

Description

"require": {
        "laravel/framework": "^9.31",
        "laravel/scout": "^9.4",
        "meilisearch/meilisearch-php": "^0.24.2",
    },
User::search('*')->raw()
=> [
     "hits" => [
       [
         "email" => "bar@foo.com",
         "id" => "bar",
         "__soft_deleted" => 0,
       ],
     ],
     "estimatedTotalHits" => 1,
     "query" => "*",
     "limit" => 20,
     "offset" => 0,
     "processingTimeMs" => 0,
     "nbHits" => 1,
   ]

Expected behavior Show me the collection/items.

Current behavior

User::search('*')->get()
=> Illuminate\Database\Eloquent\Collection {#5612
     all: [],
   }

Screenshots or Logs If applicable, add screenshots or logs to help explain your problem.

Environment (please complete the following information):

meilisearch:
        image: 'getmeili/meilisearch:latest'
        ports:
            - '${FORWARD_MEILISEARCH_PORT:-7700}:7700'
        volumes:
            - 'sail-meilisearch:/data.ms'
        networks:
            - sail
        healthcheck:
            test: ["CMD", "wget", "--no-verbose", "--spider",  "http://localhost:7700/health"]
            retries: 3
            timeout: 5s

I'm using Laravel Sail, it worked fine, but it seems to be broken on latest release. :/

francoism90 commented 2 years ago

Hmm, seems to be related to: https://github.com/laravel/scout/issues/653 https://github.com/laravel/scout/issues/651

brunoocasali commented 2 years ago

I think it is fixed already @francoism90, feel free to reopen if needed!