• Resolved freezer85

    (@freezer85)


    is there a way to select what to show first on the suggestion
    example. on our site you can search for Book author name like “Vincenzi”, can we show books( product) 1st and then author name (attribute)?

    The page I need help with: [log in to see the link]

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

    (@mihail-barinov)

    Hi,

    In fact it already must be higher in the search results. Words in title prioritize higher than the words inside other fields like attribute or product description. Also you can add even more relevance to words inside the title with some custom code snippets.

     add_filter( 'aws_relevance_scores', function ( $relevance_array ) {
    $relevance_array['title'] = 1000;
    return $relevance_array;
    } );

    You need to add it somewhere outside the plugins folder. For example, inside functions.php file of your theme or use some plugin for adding code snippets.

    Also, after adding this code you will need to go to the plugin settings page and click the ‘Clear cache’ button.

    Thread Starter freezer85

    (@freezer85)

    sorry maybe my sentence was wrong, i would like to have product made by that author to come 1st in the result even if they don’t have that specific word in the title.
    again with my example. Atuthor ahve 7 different books, but the query gives
    Author full name suggestion as 1st, other author that partially have same name and after all that, all books that have that name in one of their attribute.

    i would like to have this item to be show in the suggested result in an higer position than the Name of authors

    Plugin Author ILLID

    (@mihail-barinov)

    So to sum up you want the following – if a user searches for the author’s name – show a product that is published by this author first? Is that correct?

    Another question – author name is set via default WordPress author field or are you using any specific custom field for it?

    Thread Starter freezer85

    (@freezer85)

    it is a custom product attribute. pa_*something*, already used on search as primary key (indexed too)

    Plugin Author ILLID

    (@mihail-barinov)

    So in this case your issue can be solved by adding more relevance to words inside that author attribute. Please tell me the exact name of this attribute so I can help you with needed code snippets.

    Thread Starter freezer85

    (@freezer85)

    on search in homepage write Vincenzi

    you will find Monica Vincenzi ( author) + many other similar but not 100% corresponding (like VincenzO with a final O instead of I)



    Vincenzi ( full corresponding last name) published 7 books
    https://www.armandoeditore.it/catalogo/autore/monica-vincenzi/

    one of her book appear inside the search as 1st result of products but probably because have the word “vincenzi” inside product description (bold word on search suggestion).

    Plugin Author ILLID

    (@mihail-barinov)

    So if after searching for Vincenzi it shows some results with Vincenzo – please go to the plugin settings page and turn on ‘Misspelling fix’ option. Perhaps this will help.

    Also previously you mentioned that the author name is stored inside the product attribute. Is it pa_autore ?

Viewing 7 replies - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.