Selecting Multiple Facets Issue with cross-domain

  • wpsolr
    Keymaster
    2 years ago #29579

    You used ‘categories’ as the site filter.
    It happens that it is a special filter in WPSOLR, a hierarchical category which does not implement the ‘OR’.

    You can try to use tags or custom tags instead.

    duck
    Participant
    2 years ago #29580

    That would have been great info to have when I explained I was using categories in my second post on this thread! https://www.wpsolr.com/forums/topic/selecting-multiple-facets-issue/#post-29521

    You mentioned using a custom taxonomy for displaying subsites as facets. Will I be able to select multiple facets from a custom taxonomy using OR to combine facet selections or do I need to use tags in order to select multiple facets from different subsites? Just trying to sort out the next steps I need to take before I end up down another dead end road.

    wpsolr
    Keymaster
    2 years ago #29581

    I added a warning on the facet settings that, when the ‘OR’ option is selected, it does not work for category taxonomies. It will be available on next release.

    • This reply was modified 2 years ago by wpsolr.
    • This reply was modified 2 years ago by wpsolr.
    duck
    Participant
    1 year, 12 months ago #29635

    I now have a custom taxonomy setup on the root site and 1 subsite and have the custom taxonomy showing on the facets, however, I am still running into a similar issue. I have 3 different taxonomy terms on the root site and 1 taxonomy term on the subsite. When selecting any of the 3 facets on the root site the OR works as expected and the facets stay visible for multiple selections, however, on the subsite facet it disappears when I select any of the other 3 or vice versa. When I select the single facet from the subsite the other facets disappear or if I select one of the 3 from the root site the subsite facet taxonomy term disappears. Is there a setting I am missing on the root or subsite in order to make the OR function across subsites?

    wpsolr
    Keymaster
    1 year, 12 months ago #29638

    I now have a custom taxonomy

    Is it a custom category or a custom tag?

    duck
    Participant
    1 year, 12 months ago #29641

    It is a taxonomy created through CPT UI attached to all posts & pages, these are the settings:

    name: search_property
    label: Search Properties
    singular_label: Search Property
    description: “”
    public: true
    publicly_queryable: true
    hierarchical: true
    show_ui: true
    show_in_menu: true
    show_in_nav_menus: true
    query_var: true
    query_var_slug: “”
    rewrite: true
    rewrite_slug: “”
    rewrite_withfront: true
    rewrite_hierarchical: true
    show_admin_column: true
    show_in_rest: true
    show_tagcloud: false
    sort: false
    show_in_quick_edit: true
    rest_base: “”
    rest_controller_class: “”
    meta_box_cb: “”
    default_term: “”

    I have the same taxonomy setup on the root & 2 subsites and the taxonomy shows up for each in the facets. The root site has 3 terms, each subsite 1 single term, labeled as the subsite.

    wpsolr
    Keymaster
    1 year, 12 months ago #29642

    hierarchical: true

    WPSOLR does not support ‘OR’ for category (hierarchical) taxonomy facets.

    duck
    Participant
    1 year, 12 months ago #29643

    Sorry, forgot to mention I tried to use hierarchy because it had the same behavior with or without. Here are the new settings that are set on each taxonomy in both subsites and the root site taxonomy, saved, re-indexed, still the same behavior:

    name: search_property
    label: Search Properties
    singular_label: Search Property
    description: “”
    public: true
    publicly_queryable: true
    hierarchical: false
    show_ui: true
    show_in_menu: true
    show_in_nav_menus: true
    query_var: true
    query_var_slug: “”
    rewrite: true
    rewrite_slug: “”
    rewrite_withfront: true
    rewrite_hierarchical: false
    show_admin_column: false
    show_in_rest: true
    show_tagcloud: false
    sort: false
    show_in_quick_edit: true
    rest_base: “”
    rest_controller_class: “”
    meta_box_cb: “”
    default_term: “”

    duck
    Participant
    1 year, 12 months ago #29644

    Subsite: Financial Aid (45)
    Root site: General Information (3)
    Root site: Resources (2)
    Subsite: Ross IT (123)
    Root site: Tools (1)

    Any time I select one of the flat level root site taxonomy terms, those 3 stay intact with OR and the Subsite facets disappear. Any time I select one of the subsite facets, all others disappear.

    duck
    Participant
    1 year, 12 months ago #29645

    The options in 2.4 are the same on all sites for search_property with:
    OR selected & Sort Alphabetically

    wpsolr
    Keymaster
    1 year, 12 months ago #29648

    – Let’s call your 5 tag terms: R1, R2, R3, S1, S2 (“R” for root, “S” for subsite)
    – On site “R”: you are testing the search configured as a network search: it queries all post types of “R” and “S” from the shared index.
    – On site “R”: the facet tag is configured with a ‘OR’
    – On site “R”: the search displays all 5 facets, which is fine.
    – On site “R”: the ‘OR’ option works for terms R1, R2, R3
    – On site “R”: the ‘OR’ option does not work for terms S1, S2

    My questions:
    – On site “R”: did you activate the “Do not use other items selections to calculate the items count” option on the facet tag? (If not, please try it)
    – On site “S”: does the ‘OR’ option work for terms S1, S2 ?

    duck
    Participant
    1 year, 12 months ago #29649

    The “Do not use other items selections to calculate the items count” option on the facet tag is what worked. I set that on all 3 subsites and now the OR functions as expected across the cross-domain search. I did not test your second question since the first question seems to have solved the issue.

    Moving forward, in order for cross domain search facets to function properly:
    – No Hierarchy taxonomy is allowed
    – Select Do not use other items selections to calculate the items count

    This can be marked solved! Thank you for helping me work through the setup. Some additional notes/documentation would be helpful for others that are attempting to setup multiple subsite facets.

    wpsolr
    Keymaster
    1 year, 12 months ago #29653

    Indeed. In fact your 2 steps solution is not specific to multi-sites.

    For single sites and multi-sites:
    – ‘OR’ does not work on hierarchical taxonomies (categories)
    – The exclusion option (“Do not use other items selections to calculate the items count”) enables to see other facet values when a facet value is selected

Viewing 13 posts - 31 through 43 (of 43 total)

You must be logged in to reply to this topic.