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

    (@msaari)

    That is on purpose. Searching for parts of words like that produces lots of garbage results.

    You can change that behaviour, though, with the help of a filter function:

    relevanssi_fuzzy_query (“(relevanssi.term LIKE ‘#term#%’ OR relevanssi.term_reverse LIKE CONCAT(REVERSE(‘#term#’), ‘%’)) “)
    This filter lets you modify the way Relevanssi runs the fuzzy queries. The main thing you can do here is to change this value to “(term LIKE ‘%#term#%’) ” to make it match search term completely inside words. By default the search term in fuzzy search must match either beginning or the end of a word. #term# will be replaced by the actual search term later.

    nkovo5983

    (@nkovo5983)

    Hello Mikko,

    Is the a way to return results if someone was to enter “08055C12345” when our custom fields only have “08055C” in them.

    I am trying to come up with a way to not have to load Millions of part numbers into the custom fields on specific pages. If we could only load the first 5-6 characters of the part number. Our customers search for full part numbers, i would like to show results without having to load the whole part number on the pages.

    Any help would be greatly appreciated!!! Thank you

    Plugin Author Mikko Saari

    (@msaari)

    @nkovo5983, I gave you the solution in the other thread. However, if you have a problem, please start a new thread, that’s more helpful than posting in months-old threads.

    Mikko, where (in which file) may i add this code? What is the full line format to add it?

    Plugin Author Mikko Saari

    (@msaari)

    add_filter('relevanssi_fuzzy_query', 'rlv_mod_q');
    function rlv_mod_q($q) {
        return "(term LIKE ‘%#term#%’)";
    }

    This goes to theme functions.php.

    I added.
    For example:
    When i search doctors It gives me results for doctors.
    If (by mistake) i search dovtors it doesnt give me results.
    How can it happens for small spelling mistakes to give results?

    One more question.
    Is any code i could add so the search engine can index the permalinks (p.ex. https://domain.gr/farmacies/ to give result for the word farmacies)

    Plugin Author Mikko Saari

    (@msaari)

    For spelling mistakes, use the Did you mean -feature: https://www.relevanssi.com/knowledge-base/did-you-mean-suggestions/

    I noticed you bought Premium, so you’ll have access to the better Did you mean -feature; it does exactly what you want.

    As for indexing permalinks, that’s possible; since you have Premium, please drop me an email to the Premium support email for a solution.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Searching within words’ is closed to new replies.