You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use ElasticPress with WooCommerce and I want allow user to choose multiple terms from facets. It would be possible with match type "show all content tagged to any selected term" but with multiple facets it doesn't produce desirable result. If user chooses black from color facet and M and L from size facet then there should be only products that are color black and size of M and L. What happens instead, there'll be products that are colored black but not size of M or L and products in size of M and L that are not color black.
ElasticPress should have a third match type "show all content tagged to any selected term within a facet applying to all facets" which shows all content tagged to any selected term but only content that exists in all facets.
I tried to change 'or' to 'and' in https://github.com/10up/ElasticPress/blob/develop/includes/classes/Feature/Facets/Facets.php#L305 and it produced almost desirable result. Then I will only get products in size of M and L that are color black. However, terms won't be marked as empty if terms are chosen in other facet and they wouldn't have content. For example, if I choose a shoe size 40 and 41, I can still choose cloth size L which is absurd in our case and doesn't produce any content. It should no longer allow choosing cloth size. What should be changed to make terms considered as empty when relation between facets is AND instead of OR?
The text was updated successfully, but these errors were encountered:
I use ElasticPress with WooCommerce and I want allow user to choose multiple terms from facets. It would be possible with match type "show all content tagged to any selected term" but with multiple facets it doesn't produce desirable result. If user chooses black from color facet and M and L from size facet then there should be only products that are color black and size of M and L. What happens instead, there'll be products that are colored black but not size of M or L and products in size of M and L that are not color black.
ElasticPress should have a third match type "show all content tagged to any selected term within a facet applying to all facets" which shows all content tagged to any selected term but only content that exists in all facets.
I tried to change 'or' to 'and' in https://github.com/10up/ElasticPress/blob/develop/includes/classes/Feature/Facets/Facets.php#L305 and it produced almost desirable result. Then I will only get products in size of M and L that are color black. However, terms won't be marked as empty if terms are chosen in other facet and they wouldn't have content. For example, if I choose a shoe size 40 and 41, I can still choose cloth size L which is absurd in our case and doesn't produce any content. It should no longer allow choosing cloth size. What should be changed to make terms considered as empty when relation between facets is AND instead of OR?
The text was updated successfully, but these errors were encountered: