Skip to content

Commit

Permalink
Removing code to modify ordered facets since Algolia now supports dis…
Browse files Browse the repository at this point in the history
…playing ordered facets as configured on dashboard
  • Loading branch information
HusamAamer committed Aug 16, 2022
1 parent 1a28f7a commit c825a89
Showing 1 changed file with 0 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,37 +53,8 @@ public extension DynamicFacetListInteractor {
})
}
}
// print("====")
// print("ordering",facetOrdering.facets.order)
// print("++++")

/*

Overriding server facet ordering manually
becuase I can't access HitsSearcher index object to set renderingContent like shown here
link: https://www.algolia.com/doc/api-reference/api-parameters/renderingContent/

and I couldn't implement it using the AlgoliaSearchClient becuase of framework issue

*/

let facetOrdering = FacetOrdering(facets: FacetsOrder(order: ["hierarchicalCategories.lvl0", "facet_brand", "variations.color_code","sizes","price.value"]),
values: [:
/*
"brand": FacetValuesOrder(
order: ["uniqlo"],
sortRemainingBy: .count
),
"size": FacetValuesOrder(
order: ["S", "M", "L"],
sortRemainingBy: .hidden
)*/
])


interactor.orderedFacets = FacetsOrderer(facetOrder: facetOrdering, facets: facets)()
// print("++++")
// print("result",interactor.orderedFacets.compactMap({$0.attribute}))
} else {
interactor.orderedFacets = []
}
Expand Down

0 comments on commit c825a89

Please sign in to comment.