• Resolved WebBee

    (@bridgetdesigns)


    Hi, I am building a site for a client and they want the search results to find a product (which I have as custom post type) if the user forgets to put spaces in the name.

    So for example find ‘Product 123’ if they search for ‘Product123’.

    At the moment it doesn’t seem to do that, it just shows no results found. Am I doing something wrong, or is this not something it can do by default?

    https://www.ads-software.com/plugins/relevanssi/

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

    (@msaari)

    The fuzzy search doesn’t work like that. It doesn’t try adding spaces, because it doesn’t really know where to insert the spaces, and trying everything is not feasible.

    Is this a common problem? Do users often search for product names without spaces? If so, you may want to consider indexing the product titles both with spaces and without spaces.

    Thread Starter WebBee

    (@bridgetdesigns)

    Its the only time I have had the issue raised with me. I don’t think it is a big problem. I just thought that perhaps it would find the first part of the word and match that to something else, even if it couldn’t find the whole thing?

    Either way, I explained it wasn’t possible to the client and they are happy enough with how it works anyway now. Thanks for the reply.

    Plugin Author Mikko Saari

    (@msaari)

    What first part of the word? Relevanssi doesn’t know anythign at all about language, so to it there is no first and second part in “Product123”.

    It would be nice, if Relevanssi knew more about language, but unfortunately that is not possible.

    Thread Starter WebBee

    (@bridgetdesigns)

    Hi Mikko, thanks for your input, I am aware that Relevanssi doesn’t know anything about language, it seems you have rather missed the point of what I was asking. I was referring to the notes on their own website:

    Fuzzy search also matches parts of words, so searching for “ledge” will also finds documents that contain words “knowledge” and “ledger”. The search term has to be either in the beginning or the end of the word, so searching for “ion” will find “caution” or “ionized”, but not “cautionary”.

    https://www.relevanssi.com/user-manual/installing-relevanssi-and-adjusting-the-settings/

    Which seemed to suggest that it would in fact find the first part of any string, if that part of the string appeared as part of a ‘word’ (group of characters with a space either side), elsewhere in the site. However this does not seem to be the case, as far as I can work out so far. I opened this thread to ask if I had understood the above point correctly or not and if the search my client was looking for, was in fact covered by this.

    As I mentioned earlier in this thread though, my clients are quite happy with the search function now anyway, so it is not of any great importance.

    I did find the following notes in their user manual section, that I will definitely try out in the future though:

    relevanssi_fuzzy_query (“(term LIKE ‘%#term#’ OR term LIKE ‘#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.

    Plugin Author Mikko Saari

    (@msaari)

    Correct, Relevanssi does find parts of string. However, that doesn’t really apply to the example you gave: “Product123” is not a part of “Product 123”.

    If you have fuzzy search enabled, searching for “produc” or “123” will find “Product 123”, but “Product123” will not find anything.

    That quote from the user manual is a way to make Relevanssi find “Product 123” when searching for “duct”. Whether or not that is helpful is another thing; there’s a reason it’s not the default behaviour.

    Thread Starter WebBee

    (@bridgetdesigns)

    Ah I see, I thought perhaps it would find ‘Product’ from ‘Product123’ as one the site in question the first part of the names of all the products are the same word, so it crops up all over the site. So it would manybe find any instance of that part.

    Still, no matter.

    Thanks

    Thread Starter WebBee

    (@bridgetdesigns)

    e.g. I thought ‘Product123’ would return results with ‘Product’ in them. I understand it wouldn’t find ‘Product 123’, I just thought it might find the first part ‘Product’ as that appears on the site separately.

    Plugin Author Mikko Saari

    (@msaari)

    And as I was trying to explain to you, Relevanssi doesn’t know that “Product123” can be split into two parts of “Product” and “123”. That is trivial to humans, but impossible to Relevanssi.

    Thread Starter WebBee

    (@bridgetdesigns)

    So to clarify for anyone else looking at this thread, it can find a part of a word in a larger one, but it can’t match groups of letters within a longer string to a word.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Fuzzy search not finding part of a word’ is closed to new replies.