Facets not ‘stacking’

  • HaikoG
    Participant
    # 1 month, 1 week ago

    Hi,

    Currently testing WPSOLR on a Woocommerce shop with more than 25000 products. It’s important to us to be able to select multiple filters; For example brand:Samsung AND color:yellow.

    We’re using the “Current theme” template with AJAX with the Facets widget. When I select a brand, the results are filtered for that brand and the counts are updated in the other facets. So I can see there is only one white Samsung for example.
    But if I then click the color white, I expect to see that one product, that white samsung. Instead, the brand filter is removed and I get all white products.

    Can you please explain what I should do to get this working?

    Thanks, Haiko

    wpsolr
    Keymaster
    # 1 month, 1 week ago

    Hi,

    What you expect is what should happen indeed. The second choice (“white”) should show only white products from the brand selected (“Samsung”).

    Can you show me a screenshot of your WPSOLR screen “2.4 Filters”?

    HaikoG
    Participant
    # 1 month, 1 week ago

    Thanks for the quick reply

    It’s a large list of filters, so I’ll post the ‘Brand’ and ‘Color’ sections

    Brand: https://drive.google.com/open?id=165rY_4jt44vwnsnEpjnGhY-h6RZ_Eggf
    Color: https://drive.google.com/open?id=1m7v4ZPi0iTv-b20zNSBFV4dLSBVdZ_ZK

    This is the entire list:
    https://drive.google.com/open?id=1wBGKhyFWeLHTJ7ShU6ibVF4RrmcdLd09

    wpsolr
    Keymaster
    # 1 month, 1 week ago

    Looks fine.

    Can I see the live site?

    HaikoG
    Participant
    # 1 month, 1 week ago

    It’s a hidden staging site, is there a way I can send you a private message? Or email you directly?

    wpsolr
    Keymaster
    # 1 month, 1 week ago

    Then can you check for javascript console errors on the search page?

    And also in your WP debug logs?

    HaikoG
    Participant
    # 1 month, 1 week ago

    The console shows no errors. Debug log has a warning

    trim() expects parameter 1 to be string, array given

    Backtrace:
    wc_get_template()
    wp-content/plugins/woocommerce/templates/taxonomy-product_cat.php:22
    do_action(‘woocommerce_after_main_content’)
    wp-content/themes/mindig/woocommerce/archive-product.php:84
    woocommerce_output_content_wrapper_end()
    wp-includes/class-wp-hook.php:286
    wc_get_template()
    wp-content/plugins/woocommerce/includes/wc-template-functions.php:939
    yit_primary_sidebar()
    wp-content/themes/mindig/woocommerce/global/wrapper-end.php:41
    yit_get_template()
    wp-content/themes/mindig/theme/functions-template.php:358
    dynamic_sidebar(‘default-sidebar’)
    wp-content/themes/mindig/theme/templates/primary/sidebar.php:31
    WP_Widget->display_callback()
    wp-includes/widgets.php:743
    wpsolr\c\c\u\w\WPSOLR_Widget_Facet->widget()
    wp-includes/class-wp-widget.php:372
    wpsolr\c\c\e\WPSOLR_AbstractSearchClient->get_results_data()
    wp-content/plugins/wpsolr-pro/wpsolr/core/classes/ui/widget/class-wpsolr-widget-facet.php:56
    wpsolr\c\c\e\WPSOLR_AbstractSearchClient->get_results_results()
    wp-content/plugins/wpsolr-pro/wpsolr/core/classes/engines/class-wpsolr-abstractsearchclient.php:950
    trim()
    wp-content/plugins/wpsolr-pro/wpsolr/core/classes/engines/class-wpsolr-abstractsearchclient.php:2878
    wp-content/plugins/wpsolr-pro/wpsolr/core/classes/engines/class-wpsolr-abstractsearchclient.php:2878

    wpsolr
    Keymaster
    # 1 month, 1 week ago

    1) Which version of Elasticsearch is it?

    2) How did you create your index?

    HaikoG
    Participant
    # 1 month, 1 week ago

    Oh, I’m using Solr, self hosted. I’ve used the configuration files supplied by the plugin to create the index and the data instance

    wpsolr
    Keymaster
    # 1 month, 1 week ago

    My feeling is that your Solr index is not configured properly.

    Can you check its schema.xml file in the Solr admin console (under the index “files” menu)?

    HaikoG
    Participant
    # 1 month, 1 week ago

    Sure, this is the schema
    https://drive.google.com/file/d/1Ijikm0pfRXCOwAySj9wWXXy1H6Cx_gay/view?usp=sharing

    I think it’s coming from WP, because when I click the second filter, the first disappears from the querystring:

    First filter querysstring:
    ?wpsolr_fq%5B0%5D=pa_merk_str%3ASamsung

    Then after selecting a color, the querystring becomes
    ?wpsolr_fq%5B0%5D=pa_kleur-van-het-product_str%3AZilver%2C%20Wit

    wpsolr
    Keymaster
    # 1 month, 1 week ago

    Your schema is correct.

    trim() expects parameter 1 to be string, array given

    This error in the code looks really like a problem with the index.

    Can you test your search with a test Elasticsearch index?

    HaikoG
    Participant
    # 1 month, 1 week ago

    Alright, so I’ve created a test index on Elastic search and let it index a couple hundred products. It seems to keep the filters configuration, so it was easy to test

    Unfortunately, I see the same result. I’ve made a screencapture for you to see

    https://drive.google.com/open?id=1w9hzNGIP1X7faIf2jxJaMg5r8cLXKFB-

    Interesting is that the PHP Warning is gone, so that is indeed related to the configuration but it seems not to the problem

    • This reply was modified 1 month, 1 week ago by  HaikoG.
    HaikoG
    Participant
    # 1 month ago

    Ok, so I found something;
    If I change the layout of the filter from checkboxes to select (select2.js and regular) I’m able to “stack” the filters, but only the filters which have the select layout get stacked. The filter from the checkbox is overridden when selecting an other.

    I do like to use the checkbox layout though, UX wise that makes more sense

    wpsolr
    Keymaster
    # 1 month ago

    I reviewed your video.

    The first problem comes immediately on the first selection. The product category facet disappears after selection, leaving only the colors facet. This is abnormal.

    Do you have the same issues on the search page?

Viewing 15 posts - 1 through 15 (of 22 total)

You must be logged in to reply to this topic.