jolicode / elastically

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

[Feature] Allow multiple resource directories #195

Open johnkhansrc opened 3 weeks ago

johnkhansrc commented 3 weeks ago

The Importance of Configuring the Jolicode/Elastically Bundle to Distribute DTOs and Mappings Across Multiple Directories

In the development of complex applications, architectures such as Domain-Driven Design (DDD) or hexagonal architecture are frequently employed to structure code in a logical and maintainable fashion. These methodologies promote the separation of code into distinct modules or domains, each representing a specific segment of the system with its own set of responsibilities.

Within this context, the ability to configure the Jolicode/Elastically bundle to distribute Data Transfer Objects (DTOs) and Elasticsearch mappings across multiple directories proves highly advantageous. The following points elucidate the benefits:

johnkhansrc commented 3 weeks ago

Like this : image

johnkhansrc commented 3 weeks ago
# config/packages/elastically.yaml
elastically:
    connections:
        default:
            client:
                host:                '%env(ELASTICSEARCH_HOST)%'
                # If you want to use the Symfony HttpClient (you MUST create this service)
                #transport:           'JoliCode\Elastically\Transport\HttpClientTransport'

            # Path to the mapping directory (in YAML)
            mapping_directory:       '%kernel.project_dir%/src/*/Infrastructure/Persistence/Elastics/mapping'
damienalexandre commented 2 weeks ago

Hi! Thanks for the suggestion, the proposal for configuration looks good to me.

Would you be able to open a pull request with this change?

That would be located in the YamlProvider.

(I didn't read your wall of text I'm sorry, did you use generative IA?).

johnkhansrc commented 2 weeks ago

I might have time for that during the month of December.