Relevanssi - A Better Search
[resolved] search exact phrase with relevanssi - implement [search phrase="on"] (6 posts)

  1. teresax
    Posted 3 years ago #

    implement [search phrase="on"]

    Hello Mikko Saari
    which term should I use in my search page
    to search for the exact phrase?
    thanks in advance

    <input type="radio" name="????" value="???" /><label>exact phrase</label>


  2. Mikko Saari
    Plugin Author

    Posted 3 years ago #

    There's no parameter for exact phrase, it's done with quotes on the search term.

    However, I suppose you can make a radio button which when enabled activates some code that wraps the search term in quotes.

  3. teresax
    Posted 3 years ago #

    Hello Mikko Saari, thanks for the reply, very kind.
    How can I make that button?
    Thanks and good job

  4. Mikko Saari
    Plugin Author

    Posted 3 years ago #

    Add this to your search form:

    <input type="checkbox" name="phrase" />

    Then add this to your functions.php: http://pastebin.com/xGf3k3qc

    That should do the trick. I haven't tried the code, so it might or might not work, but that's the general idea.

  5. llizard
    Posted 2 years ago #

    I like this idea a lot and have just installed relevanssi, as well as implementing the checkbox for exact phrase. Unfortunately, the box does not stay checked so I am unable to contrast and compare to see whether there are different results if the box is unchecked. Any ideas?

    E Morris

    etherwork.net/blog/ << purposely left unlinked in an attempt to keep spammers at bay

  6. llizard
    Posted 2 years ago #

    duhhh... please excuse me for replying to myself. I had neglected to activate relevanssi.... The checkbox is working just fine now.

    Many thanks for a great plugin!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Relevanssi - A Better Search
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic