Title: &#039;WHERE 1=2&#039; problem
Last modified: August 30, 2016

---

# 'WHERE 1=2' problem

 *  Resolved [luqo33](https://wordpress.org/support/users/luqo33/)
 * (@luqo33)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/where-12-problem/)
 * Hello,
 * I’m performing several search queries on one page at my WordPress site. I wanted
   to use relevanssi to get more relevant results, but the plugin seems to be always
   turned off for each query that I run. This is fragment of code that I’m using:
 * `
    $shopArgs = array( 's' => get_query_var('s'), 'post_type' => array('wp_aff_products'),'
   posts_per_page' => 3, ); $shopQuery = new WP_Query($shopArgs);
 *  relevanssi_do_query($shopQuery);
 *  if ($shopQuery->have_posts()) {
    while($shopQuery->have_posts()) { ...
 * What am I doing wrong here, and how I can leverage the power of relevanssi? Thank
   you.
 * [https://wordpress.org/plugins/relevanssi/](https://wordpress.org/plugins/relevanssi/)

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

 *  Plugin Author [Mikko Saari](https://wordpress.org/support/users/msaari/)
 * (@msaari)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/where-12-problem/#post-6186274)
 * That is the correct way to do it. Relevanssi adds the “WHERE 1=2” to the query
   new WP_Query builds in order to save server resources, but that’s just the default
   search query, not the Relevanssi query.
 * I’m not sure, but the post_type parameter probably doesn’t take an array, give
   it a single post type as a string, or a comma-separated list of post types.
 *  Thread Starter [luqo33](https://wordpress.org/support/users/luqo33/)
 * (@luqo33)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/where-12-problem/#post-6186366)
 * Mikko,
 * My probelm was that the custom post entries were just not indexed properly. Running
   the indexer again solved the problem.
 * Thank you for a great plugin.
 *  Thread Starter [luqo33](https://wordpress.org/support/users/luqo33/)
 * (@luqo33)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/where-12-problem/#post-6186368)
 * Solved

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

The topic ‘'WHERE 1=2' problem’ is closed to new replies.

 * ![](https://ps.w.org/relevanssi/assets/icon-256x256.png?rev=3529670)
 * [Relevanssi - A Better Search](https://wordpress.org/plugins/relevanssi/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/relevanssi/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/relevanssi/)
 * [Active Topics](https://wordpress.org/support/plugin/relevanssi/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/relevanssi/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/relevanssi/reviews/)

## Tags

 * [query](https://wordpress.org/support/topic-tag/query/)
 * [request](https://wordpress.org/support/topic-tag/request/)

 * 3 replies
 * 2 participants
 * Last reply from: [luqo33](https://wordpress.org/support/users/luqo33/)
 * Last activity: [10 years, 11 months ago](https://wordpress.org/support/topic/where-12-problem/#post-6186368)
 * Status: resolved