• Resolved lyzzi22

    (@lyzzi22)


    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

    (@msaari)

    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

    (@lyzzi22)

    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.