Skip to content

Define layout.strategy on HibernateSearchElasticsearchRecorder#contributeBackendBuildTimeProperties #9349

@vitor-cardoso-tdx

Description

@vitor-cardoso-tdx

Description
I think that we should have the possibility to choose our custom layout.strategy through quarkus configuration. There are some situations that can be useful to use a custom layout like:https://docs.jboss.org/hibernate/search/6.0/reference/en-US/html_single/#backend-elasticsearch-indexlayout.

Implementation ideas
Something like this:

private void contributeBackendBuildTimeProperties(BiConsumer<String, Object> propertyCollector, String backendName,
                ElasticsearchBackendBuildTimeConfig elasticsearchBackendConfig) {
            addBackendConfig(propertyCollector, backendName, BackendSettings.TYPE,
                    ElasticsearchBackendSettings.TYPE_NAME);
            addBackendConfig(propertyCollector, backendName, **ElasticsearchBackendSettings.LAYOUT_STRATEGY,
                    elasticsearchBackendConfig.layout);**
            addBackendConfig(propertyCollector, backendName, ElasticsearchBackendSettings.VERSION,
                    elasticsearchBackendConfig.version);
            addBackendConfig(propertyCollector, backendName,
                    ElasticsearchBackendSettings.ANALYSIS_CONFIGURER,
                    elasticsearchBackendConfig.analysis.configurer,
                    Optional::isPresent, c -> c.get().getName());
        }

With the property:
quarkus.hibernate-search.elasticsearch.layout.strategy=[the custom layout bean that implements org.hibernate.search.backend.elasticsearch.mapping.TypeNameMappingStrategyName.IndexLayoutStrategy]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions