Forums › Forums › Search & Filter Pro › Only return results that match both category selections
Tagged: categories
- This topic has 7 replies, 2 voices, and was last updated 8 years, 1 month ago by
Anonymous.
-
Anonymous(Private) February 27, 2018 at 9:11 am #162369
I have a search form set up as per the screenshot link.
https://www.dropbox.com/s/uyo59vt8er2kp6o/Screen%20%202018-02-27%20at%2008.56.59.png?dl=0
Both drop downs are lists of categories. One for type of thing (bar, restaurant etc) the other area. As you can see from the screenshot a search of Bars in Ancoats returns A Pizza place (correct) and a leting agency (incorrect). I assume this is because it is bringing back results that match either term.
My question is – how do I set search and filter to only return results that match both terms?
Trevor(Private) February 27, 2018 at 12:48 pm #162420I think I see the potential issue. You can use a particular Taxonomy (or Category/Tags, each Taxonomy and each Custom Field) only once in the form. You would need to make additional custom taxonomies. This post tries to explain this a bit better (you can use a plugin to switch category terms from category to any new taxonomy that you make, so it is not so hard to do). It is a really awful preachy lecture I wrote:
https://support.searchandfilter.com/forums/topic/multiple-categories-combination/#post-55166
Sorry about the tone, but the message is right and it links to good plugins (except taxonomy switcher I think).
Anonymous(Private) February 27, 2018 at 1:46 pm #162449Right so – the plot thickens. I have installed CPT UI and added to flat custom taxonomies directory location and directory business type and added a few test terms.
https://www.dropbox.com/s/de9gc8vcply4ds5/Screen%20%202018-02-27%20at%2013.40.30.png?dl=0
I then took a couple of listings and assigned terms to them and created a new search form to search against those taxonomies.
https://www.dropbox.com/s/03o5skjcvfzkiyq/Screen%20%202018-02-27%20at%2013.40.15.png?dl=0
Search form looks fine, but it is not returning the two listings when I search on the terms I have added. Note: I have removed all the original categories assigned (just in case) on the two listings i am testing.
https://www.dropbox.com/s/9mh9y77cmo0dp8r/Screen%20%202018-02-27%20at%2013.39.52.png?dl=0
I feel like this is set up correctly now and should work – a bit stumped.
http://staging.manchestersfinest.com/find
Thank you for your help.
-
AuthorPosts