algolia / scout-extended

Scout Extended: The Full Power of Algolia in Laravel
https://www.algolia.com/doc/framework-integration/laravel/getting-started/introduction-to-scout-extended/
MIT License
393 stars 85 forks source link

EngineManager doesn't honor scout.identify configuration #323

Open renanbr opened 12 months ago

renanbr commented 12 months ago

Description

Algolia analytics dashboard doesn't recognise user searches because the application doesn't send the X-Algolia-UserToken header when performing searches even when configuring SCOUT_IDENTIFY env var to true.

Steps To Reproduce

Shkeats commented 7 months ago

I've just run into this issue too. Relevant code is in vendor/laravel/scout/src/EngineManager.php defaultAlgoliaHeaders() method but it never gets executed.

Scout docs https://laravel.com/docs/10.x/scout#identifying-users

szhorvath commented 4 months ago

Does anyone know a workaround for the issue?

renanbr commented 4 months ago

Does anyone know a workaround for the issue?

We override the EngineManager with a housemade class overriding the createAlgoliaDriver() method.

This approach made us able to fix scout.algolia.*_timeout configuration as well.