Sylius / SyliusElasticSearchPlugin

DEPRECATED! Use https://github.com/BitBagCommerce/SyliusElasticsearchPlugin instead.
22 stars 26 forks source link

When filtering by taxonSlug, price range is returned with wrong maxBounds value #89

Closed krafas closed 6 years ago

krafas commented 6 years ago

When searching by query, minBounds and maxBounds of priceRange is returned valid. It looks like that only when searching by taxonSlug, priceRange.maxBounds value is always max value from all products.

I would like that maxBounds value would be the max value of current taxon (+ all children). Any ideas where to start digging?

psihius commented 6 years ago

@krafas Enter debug mode and check what query for Elastic is generated and if that looks correct. To be honest, I have never encountered such behavior, so some debugging is required. Check also the raw responses from Elastic to verify what it returns.

krafas commented 6 years ago

@psihius do you know how aggregations works? I'm totally new in ES and this all ongr stuff :) Maybe some "deeper" filters should be set for priceRange? It looks like, that filter priceRange aggregates stats from all products, when search query is empty.

krafas commented 6 years ago

OK, the problem was that by default SyliusElasticSearchPlugin defines taxon filters as sylius_elastic_search.choice_nested type, so no query to ES is given. The only one filter which adds query is search, so I overwrited ongr_filter_manager configuration and changed taxonSlug to be match type.