When selecting an option in a filter using the default configuration makes other option groups disappear.
The default configuration of options is:
options:
type: sylius_elastic_search.multi_dynamic_aggregate_options
request_field: options
document_field: variants>variants.options>variants.options.value.raw
options:
name_field: variants.options.name.raw
sort_type: _term
sort_order: asc
size: 100
The document field variants>variants.options>variants.options.value.raw defines a double nested aggregation to get to the variant's options. Because of this double nested aggregation the sylius_elastic_search.multi_dynamic_aggregate_options filter type is needed to override ONGR's default functionality. This override however, breaks the default functionality.
Changing the document field to variants.options>variants.options.value.raw (directly pointed to the variant's options in a single nested aggregation) makes the need for an overridden filter type redundant. By changing this document field, we're able to make use of the sylius_elastic_search.multi_dynamic_aggregate filter type. The excess OptionMultiDynamicAggregate could be removed.
By making use of the MultiDynamicAggregate filter type, functionality of multiple option groups is restored.
The new configuration for options would be:
options:
type: sylius_elastic_search.multi_dynamic_aggregate
request_field: options
document_field: variants.options>variants.options.value.raw
options:
name_field: variants.options.name.raw
sort_type: _term
sort_order: asc
size: 100