Fix #10618 - Order of modules in unified search results does not correspond to order in settings (Elasticsearch) #10619
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Modified the parseHits function in /lib/Search/ElasticSearch/ElasticSearchEngine.php so that the search results are parsed based on the order given in Search Settings.
Description
I added a loop before the loop over initialResults which sets the keys of the array to be the enabled modules which are set in Admin->'Search Settings'
'''
private function parseHits(array $hits): array
{
$hitsArray = $hits['hits']['hits'];
'''
Motivation and Context
Clients have complained that the order of the results of the unified search doesn't match the order they defined in Admin->'Search Settings'.
How To Test This
This is a bugfix for issue #10618, so to test this you can simply try to reproduce the bug as described in the bug report.
Types of changes
Final checklist