Closed
Description
Context: Engines, like Algolia, allow to define the ranking - order of the results.
An example could be: I want products to be sorted by the quantity, so when I type "iphone" i want to get the ones that I have more in stock.
Problem: The method AlgoliaEngine::map
does not return the models in the same order of the returned results by Algolia. Mainly because a whereIn
is applied behind-the-scenes.
Solution: Sort the models by the same order of the given results just before returning the result of AlgoliaEngine::map
.