• Resolved richardu

    (@richardu)


    I want to search for any version of produce, production, producer, produced produces, etc. So I set for fuzzy matching, enter ‘produc’ and it works. Next, I also want to search for any version of generate, generator, generated, etc. So I change my search to ‘produc,generat’ and it doesn’t work. Then I change my default operator to OR and it works again. However now I want to search for an exact phrase “producer index” and it picks up any article with “producer” or “index.” How can I do an exact phrase search when the Default operator is OR? More specifically, what settings will accommodate all three of the cases above?

    Thanks, Richard

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Mikko Saari

    (@msaari)

    If you search for "producer index" with the quotes, you should only see posts with that exact phrase, no matter whether you have OR or AND enabled.

    Thread Starter richardu

    (@richardu)

    Thanks so much for confirming that. By eliminating a variable, you allowed me to focus on the correct tests and figure out the problem. I hope this information is helpful to someone else.

    I was creating permanent search links by doing a search and inserting the resultant url into the text editor. That usually works, but with exact phrase searches, I got html that looks like:

    <a href="https://example.com/?s="free+speech"">link</a>

    The double quotation marks were causing the problem, and needed to be changed to:

    <a href="https://example.com/?s='free+speech'">link</a>

    Thanks again.

    • This reply was modified 7 years, 4 months ago by richardu.
    Plugin Author Mikko Saari

    (@msaari)

    You can use the double quotes, but then you have to use single quotes for the href parameter:

    <a href='https://example.com/?s="free+speech"'>link</a>

    Even better if you encode the quotes:

    <a href="https://example.com/?s=%22free+speech%22">link</a>

    If you use single quotes for the phrase, Relevanssi won’t recognise it as a phrase, Relevanssi expects a double quote.

    Thread Starter richardu

    (@richardu)

    Thanks so much. I had figured out that out with more trial and error, but I’m glad it is here now for all to see.

    By the way, I couldn’t find rules for user search documented anywhere. Maybe I missed it.

    Plugin Author Mikko Saari

    (@msaari)

    Not a surprise, the basic documentation is missing lots of detail.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Exact phrase search with OR operator’ is closed to new replies.