Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Match type for any term within facet, all terms between facets #1775

Closed
torava opened this issue May 15, 2020 · 1 comment
Closed

Match type for any term within facet, all terms between facets #1775

torava opened this issue May 15, 2020 · 1 comment

Comments

@torava
Copy link

torava commented May 15, 2020

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?

@torava torava added the type:enhancement New feature or request. label May 15, 2020
@felipeelia felipeelia removed the type:enhancement New feature or request. label Apr 30, 2021
@felipeelia
Copy link
Member

As this and #1933 asks for the same enhancement, I'm closing this one out in favor of that other.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants