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
395 stars 85 forks source link

Should allow to change full objectId #293

Closed osama-klabs closed 2 years ago

osama-klabs commented 2 years ago

Description

I am trying to change objectId from App\Models{anyModel}::{id} to id{id} Below function only change the key not whole objectId (model name)

public function getScoutKey()
    {
        return $this->id;
    }

Steps To Reproduce

Just run import command you will see the objectId in terminal

DevinCodes commented 2 years ago

Hi @osama-klabs ,

Unfortunately, it's not possible to do this. The logic that generates this key lives in the final class ObjectIdEncrypter. Since this is a final class, it's not possible to override any methods on it.

May I ask why you need to update the objectID format exactly? Perhaps we can find a way around that requirement.

osama-klabs commented 2 years ago

I have multiple projects with different model namespace like App\Models\Product, App\Product etc and they are using same database as well as algolia account