• Resolved WebsitesbyMark

    (@websitesbymark)


    Im looking for basically a wild card search, that is to say searching for 36 would come up for 36,3600 and 1360.

    At the moment I cant get Relevanssi to bring back results as per above.

    Please confirm if Relevanssi has this ability (and if so please confirm settings needed for this) and if not if you will be including this in the future. This can aslo sometime be referred to as a ‘needle in a haystack’ search.

    If you want to test this http://www.localspider.co.uk/dev/smb/?s=L1680 and it should bring back a result for s688 (the search text L1680 is within a custom field which contains the data DDL1680NMB )I have rigged the settings to include the searching of custom fields so I know that is not the issue.

    If the plugin does nto include this ability any help to acheive it would be appreciated.

    https://wordpress.org/plugins/relevanssi/

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

    (@msaari)

    By default, Relevanssi fuzzy search matches the beginning and the end of a word. If you want total wildcard search, you can use relevanssi_fuzzy_query filter to fix it.

    add_filter('relevanssi_fuzzy_query', 'rlv_totally_wild');
    function rlv_totally_wild() {
        return "(relevanssi.term LIKE '%#term#%')";
    }
    Thread Starter WebsitesbyMark

    (@websitesbymark)

    Thank you for looking at this for me. It works as I want it to now.

    Hi Mikko , thank you for the code, gets me a bit closer.

    What i’m trying to do is get ‘cats’ to show the same result as ‘cat’.

    Is that possible?

    Warm regards,
    George

    Plugin Author Mikko Saari

    (@msaari)

    Phpdudes, what you need is a stemmer that removes the ‘s’ from the end of the plural forms. There’s a simple stemmer included in Relevanssi Premium, and building one yourself is not particularly tricky, you can use relevanssi_remove_punctuation filter to process every word as it’s being indexed.

    Thank you for the reply, great idea with the stemmer but i thin it would still not sort it entirely.

    Basically what i’m trying to accomplish is
    ‘abc’ and ‘abcdf’ should show the same resuls (or abc should show more results cause you can find ‘abcx’

    Basically even if a word is misspelled it would still find the results.

    For example if you search “Scarf” you get 22 results but if you search “scarv” only 2 results and if someone misspells it as in “scarfe” you get no results)`

    here is the testing site :

    http://bit.ly/1tgKdNg

    Plugin Author Mikko Saari

    (@msaari)

    With fuzzy search enabled, “abc” will find the same results as “abcdf”, but there’s no scenario where “abcdf” will find the same results as “abc”, and I don’t quite know how that would be possible in a reasonable way.

    What comes to “scarf” vs “scarv”, to fix search like that, you’d pretty much need to cover all individual cases manually. Relevanssi just doesn’t have that kind of language processing understanding.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Fuzzy search not working as expected’ is closed to new replies.