jolicode / elastically

🔍 JoliCode's Elastica wrapper to bootstrap Elasticsearch PHP integrations
248 stars 37 forks source link

Add a bridge : A bundle for Symfony #86

Closed lyrixx closed 1 year ago

lyrixx commented 3 years ago
elastically:
    connections:
        default:
            client:
                host: '%env(ELASTICSEARCH_HOST)%'
            mapping_directory: '%kernel.project_dir%/config/elasticsearch'
            index_class_mapping:
                beers: App\Dto\Beer

See the readme for more information

damienalexandre commented 2 years ago

How can we move forward with this idea?

From what I see, we miss some documentation?

lyrixx commented 2 years ago

I need some time...

And we need to take a decission: Do we support only one connection, or do we allow many?

Korbeil commented 2 years ago

IMO, we should go simple as first implementation and support only one connection, if someone has needs for more we can create a new issue and make a new iteration of that feature later.

lyrixx commented 2 years ago

I would like to avoid that.

Because supporting theses two configuration is really boring

client:
    host: 127.0.0.1
    mapping: data/mapping.yaml
client:
    default:
        host: 127.0.0.1
        mapping: data/mapping.yaml
    another:
        host: 127.0.0.2
        mapping: data/mapping2.yaml

I already have a POC on my computer to support N connexion. I need not so much time to finish it I guess

damienalexandre commented 2 years ago

I agree with @lyrixx, multiple connexion from the start is good. We must solve the autowiring that's all.

lyrixx commented 1 year ago

I just pushed a new version. still in WIP

The configuration has the following shape:

elastically:
    connections:
        default:
            prefix:               null
            index_class_mapping:
                my-index:            My\Dto
            serializer:
                context_mapping:
                    foo:                 bar
            client:               []
            mapping_directory:    ~
lyrixx commented 1 year ago

Here we go! New version published. I added everything I wanted. I wrote some documentation. Can I have a review please? And if it's okay, I'll write some tests eventually

damienalexandre commented 1 year ago

Thanks!