Support » Plugin: Relevanssi - A Better Search » Display search results for only a part of the search word

  • Resolved cap75482928

    (@federicocapanni)


    Hi, it is possible to display search results for only a part of the search word

    For example, if I search for the word “bavaglio” it will bring up search results that match the first five letters of the word, “bavag”

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

    (@msaari)

    In order to be able to help you out here, what is the actual problem you’re looking to solve? Why do you want this?

    In general arbitrary shortening of search terms is going to lead to lots of garbage results. If you’re looking for wider matching to different word forms, Relevanssi Premium has an Italian stemmer available, which is a more intelligent approach to this.

    Thread Starter cap75482928

    (@federicocapanni)

    Hi Mikko, this is my issue.

    I’ve a lot of item on my store, and many of them have a similar name which user can use to search them.

    Example:
    Bavaglino, bavagli, bavaglio, bavaglini
    Pigiama, pigiamino, pigiamini, pigiami
    Bici, biciletta, biciclette, biciclettine
    tuta, tutine, tutina
    vestito, vestitino
    cappello, cappellino,

    etc etc

    Plugin Author Mikko Saari

    (@msaari)

    I don’t think automatic cutting of search terms is a good choice here – it would make the search very unprecise.

    A combination of techniques gives you the best solution:

    1. Use synonyms. If you have just two similar forms, make them synonyms.

    2. Normalize manually. In cases where there’s a common root for all the forms, you can write a small PHP function that will normalize the forms to that root, for example convert “bavaglino”, “bavaglio” and “bavaglini” all to “bavagli”.

    3. Add a custom field to your products where you can list alternative forms, or make sure those alternative forms appear in your product descriptions otherwise.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.