WordPress.org

Forums

Relevanssi - A Better Search
How to restrict results to whole word only? (10 posts)

  1. westcoastcontent
    Member
    Posted 4 years ago #

    How do I restrict results to whole word only?

    Search for door returns door, doors, doorway even when the search is "door"

    Search for GE returns ge, get, general even if "GE"

    Search for "GE " returns ge, age, message

  2. Mikko Saari
    Member
    Plugin Author

    Posted 4 years ago #

    Turn off fuzzy searching.

  3. westcoastcontent
    Member
    Posted 4 years ago #

    Sorry, should have indicated "fuzzy" is already OFF.

    Thank you

  4. Mikko Saari
    Member
    Plugin Author

    Posted 4 years ago #

    Which version of the plugin are you running?

    I just tested this on my blog, and it works just as it should: no partial matches are made unless fuzzy searching is turned on.

  5. westcoastcontent
    Member
    Posted 4 years ago #

    2.7.4

    When to use fuzzy matching? Don't use fuzzy search

    Best,
    WCC

  6. westcoastcontent
    Member
    Posted 4 years ago #

    Update just showed up, now 2.7.5, same issue.

    Try it for yourself, search "ge"

    http://homeimprovementandrepairadvice.com/

    Best

  7. Mikko Saari
    Member
    Plugin Author

    Posted 4 years ago #

    I tried, and it seems to be working correctly.

    If I search for 'ge', I get five posts, all of which contain the word 'ge'. Fuzzy search should return just about every post.

    The highlighting will highlight partial matches as well, but that's just the highlighting.

  8. westcoastcontent
    Member
    Posted 4 years ago #

    Using the searchbox on my home page on the right column, seacging for the term "GE" returns 5 threads on the first page, it highlighs GE as well as get, message, range, age, and blockage. Using the " " should restrict the results to just the whole word "GE"

    Again fuzzy is off.

    http://homeimprovementandrepairadvice.com/

    Best

  9. Mikko Saari
    Member
    Plugin Author

    Posted 4 years ago #

    Yes, like I said: the results are correct, the highlighting just highlights partial words as well.

    If the search really searched for ge, *ge and ge*, it would match just about every post in your database. You do have more than five posts, right?

    The search works just as it should, it's just the highlighting that's confusing you. The highlighting has nothing to do with how the results are found; I just haven't bothered to make the highlighting only highlight whole word matches when fuzzy search is off.

  10. westcoastcontent
    Member
    Posted 4 years ago #

    Yes, more than 5 results (just 5 shown per page).

    Thank you for the clarification on the highlighting, was basing my question on the what was highlighted.

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

Tags