Can I combine 2 fields into one facet filter?
-
prakashreddy.imduriParticipant1 year, 3 months ago #30121
Can I combine 2 fields into one facet filter, we’ve several custom fields in the taxonomy, out of these, we want to combine 2 fields into as one facet filter. Is this at all possible either by custom code changes?
The backend CMS still carry the fields separately on custom content, but search facet filter to show the values of 2 fields into on filter.
Please suggest.wpsolrKeymaster1 year, 3 months ago #30122Please follow the code example: https://www.wpsolr.com/forums/topic/building-a-custom-facet-from-an-acf-post-type-relationship/
The idea is to use a WPSOLR action to insert your custom field value calculated from your taxonomies or custom fields (or anything else).- This reply was modified 1 year, 3 months ago by wpsolr.
prakashreddy.imduriParticipant1 year, 2 months ago #30220In our case we need to combine to 2 post taxonomies filters into one filter (Sectors and Products & Services into Sectors). Is it work as in the below link?
Can you please suggest us?
prakashreddy.imduriParticipant1 year, 2 months ago #30222For that should we need to enable ACF extension from active extensions?
wpsolrKeymaster1 year, 2 months ago #30223ACF is not needed. For example https://www.wpsolr.com/forums/topic/building-a-custom-facet-from-an-acf-post-type-relationship/#post-8673 is not using ACF.
prakashreddy.imduriParticipant1 year, 2 months ago #30226Thanks for your reply. In which file we can add the custom filter code.
add_filter(WPSOLR_Events::WPSOLR_FILTER_POST_CUSTOM_FIELDS, ‘post_custom_fields’, 10, 2);
You must be logged in to reply to this topic.