WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. teresax
    Member
    Posted 1 year 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
    Teresa.

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

    http://wordpress.org/extend/plugins/relevanssi/

  2. Mikko Saari
    Member
    Plugin Author

    Posted 1 year 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
    Member
    Posted 1 year ago #

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

  4. Mikko Saari
    Member
    Plugin Author

    Posted 1 year 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
    Member
    Posted 11 months 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
    Member
    Posted 11 months 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

About this Topic