Skip to content
This repository was archived by the owner on Aug 3, 2018. It is now read-only.
This repository was archived by the owner on Aug 3, 2018. It is now read-only.

Selecting an option in a filter makes other option groups disappear #82

@MartijnHarte

Description

@MartijnHarte

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions