• Resolved baraak

    (@baraak)


    Hi,

    Thank you for this awesome plugin. i’m having a problem where a search returns no result if long tail keyword is typed.

    for example, if i have a yoga mat, and search for a yoga mat, the product will be displayed. However if i type “yoga mat red”, the search will yield no results!

    How do i force the plugin to display results for partial search term?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Kris

    (@c0nst)

    Hi @baraak!

    In the free version of the FiboSearch, product search is limited to the title, short description, and long description. If “yoga mat red” is the full product name, it should appear in the search results. However, the free version won’t consider such details if “red” is an attribute, such as the product’s color.

    Regards,
    Kris

    Thread Starter baraak

    (@baraak)

    Hi Kris,

    My question is not about attributes.

    If a customer types “yoga mat red”, how is it possible to have FiboSearch ignore the word that led to no results? the expected output i’m looking for is to have Fibosearch display results for “yoga mat” if “yoga mat red” led to no results.

    • This reply was modified 6 months, 2 weeks ago by baraak.
    Plugin Support Kris

    (@c0nst)

    Hi @baraak!

    Thanks for clarifying this. This can be done with the following code:

    add_filter( 'dgwt/wcas/phrase', function( $phrase ) {
        $replacements = [
            'yoga mat red' => 'yoga mat',
        ];
    
        foreach ( $replacements as $search => $replace ) {
            $phrase = str_replace( $search, $replace, $phrase );
        }
    
        return $phrase;
    }, 20 );

    You have two ways to add this code to your theme:

    1. Open the functions.php in your child theme and add the code at the end.
    2. or install the Code Snippets plugin and apply this code as a snippet.

    Regards,
    Kris

    Thread Starter baraak

    (@baraak)

    Hi Kris,

    After much reading, i noticed that i was asking this the wrong way. let me explain better:

    it appears that FiboSearch uses AND operator to find search results. thus in our example it looks for yoga+mat+red. and if all 3 words are not available in a single product, it will lead to no results.

    What i’m looking for, is to tell the search engine: if you don’t find a match for all 3 words combined, try to look for 2 of them only. and display results for yoga+mat OR yoga+red OR red+mat, OR mat+red.

    i’m not looking for specific words. i do have thousands of products, and thus i’m trying to make the search lead to the nearest available results.

    Plugin Support Kris

    (@c0nst)

    Hi @baraak!

    Thanks for that. Unfortunately, FiboSearch free does not have such functionality.

    Regards,
    Kris

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Partial term result if no results found?’ is closed to new replies.