Jaeyson
06/09/2022, 8:40 AMtypesense/laravel-scout-typesense-driver
)Kishore Nallan
06/09/2022, 8:52 AMJaeyson
06/09/2022, 8:55 AMHttp\Client\Exception\NetworkException with message 'Failed to connect to localhost port 8108: Connection refused for "<http://localhost:8108/collections/todo>".'
Steps to reproduce
1. added in my existing docker-compose.yml
...
typsense:
image: typesense/typesense:0.22.2
container_name: typesense
environment:
TYPESENSE_DATA_DIR: /data
TYPESENSE_API_KEY: xyz
volumes:
- /tmp/typesense-server-data:/data
ports:
- "8108:8108"
restart: "no"
networks:
laravel:
...
2. docker compose up -d, then curl <http://localhost:8108/health>
which returned {"ok":true}
3. Followed the readme instructions section:
- dependencies (guzzle7 adapter and laravel-scout-typesense-driver)
- service provider
- artisan vendor:publish ...
- config/scout.php
- Searchable
trait as well as TypesenseDocument
interface
- setting SCOUT_DRIVER
value to typesense
- php artisan scout:import App\\Models\\Todo
Expected Behavior
returning the searched results
Actual Behavior
After the installation and syncing, I tried this inside `tinker`: Todo::search('Test')->get();
then i get this
>>> Images::search('female')->get()
Http\Client\Exception\NetworkException with message 'Failed to connect to localhost port 8108: Connection refused for "<http://localhost:8108/collections/todo>".'
Metadata
Typsense Version: 0.22.2
OS: macos 12.4
Laravel v8em1nos
06/09/2022, 12:39 PMem1nos
06/09/2022, 12:42 PMJaeyson
06/09/2022, 12:56 PMtypesense
(container_name
) 🤦. It’s now working, thanks so much for pointing it out!!!Kishore Nallan
06/09/2022, 1:44 PMem1nos
06/09/2022, 1:46 PM