Title: Complex queries
Last modified: May 24, 2024

---

# Complex queries

 *  Resolved [lyzzi22](https://wordpress.org/support/users/lyzzi22/)
 * (@lyzzi22)
 * [2 years ago](https://wordpress.org/support/topic/complex-queries/)
 * I’m working with a client on adding Relvanssi search to a site we’ve built for
   them, and have a question about the optimal settings to get something to work
   correctly.
 * They’d like to have this syntax “cat” and “dog” return results that include both
   the word cat and the word dog, and our current settings the results are also 
   including the word and highlighted in the results (along with cat and dog). It
   appears that if we do “cat” “dog” or “cat” + “dog” the behavior we want happens,
   so wondering if there is a way to make it also work for “cat” and “dog” as the
   search query.

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

 *  Plugin Author [Mikko Saari](https://wordpress.org/support/users/msaari/)
 * (@msaari)
 * [2 years ago](https://wordpress.org/support/topic/complex-queries/#post-17777795)
 * The free version of Relevanssi does not support AND operator. “And” is just the
   word “and”. “And” should be a stopword, in which case search `cat and dog` is
   the same as searching for `cat dog`. The operator – AND or OR – is controlled
   from Relevanssi settings.
 * Relevanssi highlights stopwords, but doesn’t use them for searching. If “and”
   is a stopword as it should be and the default operator is set to AND, searching
   for `"cat" and "dog"` will return all posts that have “cat” and “dog”, and will
   highlight all three words in the search results.
 * Putting a single word in quotes does nothing. Quotes are the phrase operator,
   so if you search for `"cat dog"`, you’ll only get posts with the exact phrase“
   cat dog”.
 * Relevanssi Premium has the AND operator in searches. If your search is set to
   use the OR operator, you can search for `cat +dog` or `dog +cat` to use the AND
   operator, just like in Google.
 *  Thread Starter [lyzzi22](https://wordpress.org/support/users/lyzzi22/)
 * (@lyzzi22)
 * [2 years ago](https://wordpress.org/support/topic/complex-queries/#post-17778895)
 * Ok great, thank you for the quick reply – much appreciated!

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

The topic ‘Complex queries’ 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/)

 * 2 replies
 * 2 participants
 * Last reply from: [lyzzi22](https://wordpress.org/support/users/lyzzi22/)
 * Last activity: [2 years ago](https://wordpress.org/support/topic/complex-queries/#post-17778895)
 * Status: resolved