Title: Search logic
Last modified: September 1, 2016

---

# Search logic

 *  Resolved [plamenad](https://wordpress.org/support/users/plamenad/)
 * (@plamenad)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/search-logic/)
 * Hi,
    Could you please explain what is the search logic – OR / AND ? It’s seems
   like it’s OR which doesn’t make sense.. If true – how can that be changed? Tnx
   a lot 🙂
 * [https://wordpress.org/plugins/beautiful-taxonomy-filters/](https://wordpress.org/plugins/beautiful-taxonomy-filters/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Jonathandejong](https://wordpress.org/support/users/jonathandejong/)
 * (@jonathandejong)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/search-logic/#post-7710538)
 * Hi Plamenad,
 * No the search logic is AND.
    So If you search for term 1 in tax 1 and term 2 
   in tax 2 the query would look like
 *     ```
       'tax_query' => array(
       	'relation' => 'AND',
       	array(
       		'taxonomy' => 'tax1',
       		'terms' => array('term1')
       	),
       	array(
       		'taxonomy' => 'tax2',
       		'terms' => array('term2')
       	)
       )
       ```
   
 * I say *would* look like because the actual query is done entirely by WordPress
   Core.
    BTF does not create the query itself but rather redirects to custom rewrite
   urls for core supported queries like `posttype/?tax=term&tax2=term2`
 * However at the moment BTF does not automatically update the dropdowns after a
   selection has been made (before you hit the filter button) so it’s possible to
   land on a filter with no results. An update is in the works where I use AJAX 
   to update the dropdowns continually to avoid this.
 * If you’re still certain that you’re seeing an OR logic you probably have another
   plugin that’s messing with it 🙂
 *  Thread Starter [plamenad](https://wordpress.org/support/users/plamenad/)
 * (@plamenad)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/search-logic/#post-7710539)
 * Hi,
    This sounds great but .. If I have for example 4 posts in category “Test”
   and only one of them had a taxonomy “english” after filtering the posts by both
   parameters category “Test” and Taxonomy “english” it shows me all the four posts
   that are in a category “Test” .. So i guess that maybe the problem is in the 
   taxonomy plugin.. So could you please advice which taxonomy plugin is working
   well with yours? Thank you!
 *  Plugin Author [Jonathandejong](https://wordpress.org/support/users/jonathandejong/)
 * (@jonathandejong)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/search-logic/#post-7710543)
 * Hi,
 * Need a bit more info 🙂
    1. Are you using a CPT and a Taxonomy (not regular categories)?
   2. Have you activated the CPT in BTF settings? 3. Do you use any rewrite slug
   on either the cpt or taxonomy that’s different than the slug you register with(
   for example registering a cpt “books” giving it a rewrite slug of “book”.
 *  Thread Starter [plamenad](https://wordpress.org/support/users/plamenad/)
 * (@plamenad)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/search-logic/#post-7710545)
 * Hi,
    I am using the regular categories and a taxonomies is that a problem? Should
   i use the CTP categories instead? Also.. Yes I do rewrite slugs of the taxonomy
   filters..
 *  Plugin Author [Jonathandejong](https://wordpress.org/support/users/jonathandejong/)
 * (@jonathandejong)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/search-logic/#post-7710548)
 * There’s no support for regular categories in BTF. These have a special rewrite
   already by WordPress which I have not been able to make work. Spent countless
   hours.. :/
 * So you need to only use CPT and custom taxonomies.
    Also, If you do rewrite slugs
   you need to make sure the query_var parameter is also set to the same slug.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Search logic’ is closed to new replies.

 * ![](https://ps.w.org/beautiful-taxonomy-filters/assets/icon-256x256.png?rev=1654967)
 * [Beautiful taxonomy filters](https://wordpress.org/plugins/beautiful-taxonomy-filters/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/beautiful-taxonomy-filters/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/beautiful-taxonomy-filters/)
 * [Active Topics](https://wordpress.org/support/plugin/beautiful-taxonomy-filters/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/beautiful-taxonomy-filters/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/beautiful-taxonomy-filters/reviews/)

## Tags

 * [filter](https://wordpress.org/support/topic-tag/filter/)
 * [taxonomy](https://wordpress.org/support/topic-tag/taxonomy/)

 * 5 replies
 * 2 participants
 * Last reply from: [Jonathandejong](https://wordpress.org/support/users/jonathandejong/)
 * Last activity: [9 years, 8 months ago](https://wordpress.org/support/topic/search-logic/#post-7710548)
 * Status: resolved