Laravel Package related Issue Resolved (`typesense/laravel-scout-typesense-driver`)
TLDR Jaeyson faced a network exception while setting up typesense/laravel-scout-typesense-driver
on Docker. em1nos solved the issue by suggesting changing the hostname to "typesense".
2
1
Jun 09, 2022 (19 months ago)
Jaeyson
08:40 AMtypesense/laravel-scout-typesense-driver
)Kishore Nallan
08:52 AM1
Jaeyson
08:55 AMDescription
Hi! im getting networkexception, but im not sure if this has something to do with me setting up from docker or something else.
Http\Client\Exception\NetworkException with message 'Failed to connect to localhost port 8108: Connection refused for "".'
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 "".'
Metadata
Typsense Version: 0.22.2
OS: macos 12.4
Laravel v8
em1nos
12:39 PMI'm guessing a bit now. I'm using Lando, which is using docker under the hood, so it's a bit different than using docker directly.
2
em1nos
12:42 PMJaeyson
12:56 PMtypesense
(container_name
) :face_palm:. It’s now working, thanks so much for pointing it out!!!Kishore Nallan
01:44 PMem1nos
01:46 PMTypesense
Indexed 3011 threads (79% resolved)
Similar Threads
Collaborative Project on Laravel Scout Integration with Typesense
Joe used Typesense and Laravel to index documents quickly. He suggested adding Typesense to Laravel Scout docs. Jason agreed and asked community members for help. Abdullah volunteered to maintain the integration. Raises were raised and plans discussed, with unexpected resistance from official channels.
Collaborating on Laravel Scout Engine for Typesense
Jason invited contributors Abdullah and Tim for a collaboration on the Laravel Scout engine for Typesense. They discussed framework intricacies and agreed to collaborate under Typesense's GitHub organization.
Incorporation of Laravel Scout Engine to TypeSense Organization
Jason and Alex discuss adopting Abdullah's Laravel Scout Engine into the TypeSense organization. Abdullah agrees, leading to Jason creating a repo within the organization and hi019 helping to complete transition tasks.
Issue with Laravel Scout After Typesense 0.24 Update
em1nos had issues with Laravel Scout after Typesense 0.24 update. Jason suggested rolling back to v5.1.0, which resolved the issue.
Installing and Running Typesense Server on Fedora 35
User Edson struggled to initiate Typesense server. Jason suggested using the RC build for Fedora 35. After troubleshooting and following instructions, Edson was finally able to start their server. They discussed the need for clearer installation documentation since it was an incompatibility issue with Fedora 35.