In a viewController of my app, I use a query to get product objects with specific property :
let query = Query() query.filters = "NOT best_offer.applied_discounts.operation_type:\"marketing\" AND best_offer.discounted:true"
In another viewController, I use InstantSearch and I would like to do a filter with the same query.
(I want to search in products that match this filter)
I tried to use facetRefinement like this :
InstantSearch.shared.searcher.params.addFacetRefinement(name: "NOT best_offer.applied_discounts.operation_type", value: "marketing") InstantSearch.shared.searcher.params.addFacetRefinement(name: "best_offer.discounted", value: "true"
But this return no result.
I also tried
InstantSearch.shared.searcher.params.filters = "NOT best_offer.applied_discounts.operation_type:\"marketing\" AND best_offer.discounted:true"
But this time it return all the elements. The filter it is not taken into account.
How can I add a query to InstantSearch in Swift ?
Thanks for your help.