jolicode / elastically

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

Allow multiple resource directories #195

Open johnkhansrc opened 13 hours ago

johnkhansrc commented 13 hours 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 13 hours ago

Like this : image

johnkhansrc commented 13 hours 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'