Skip to content

Search: Maintain ordering of Aggregations between code and display in widget #8096

@nickdaugherty

Description

@nickdaugherty

Steps to reproduce the issue

Apply filters (Aggregations) by using the Jetpack_Search::set_filters() function, then run a search and observe the ordering of the filters as displaying in the Widget - they can be out of order.

What I expected

The ordering of the Aggregations as presented in the Widget should match the ordering from the Jetpack_Search::set_filters() call.

What happened instead

Random ordering in Widget.

Fix

This is fixed on dotcom but needs to come over. ES 2.x doesn't seem to return Aggregations in the same order in which they were passed in the query, where Facets used to be returned in the same order.

Just need a few lines of code to recreate the result array, in the right order.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugWhen a feature is broken and / or not performing as intended[Feature] SearchFor all things related to Search

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions