Synonyms implementation

This topic contains 16 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 3 years, 11 months ago.

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #26645
    Voidmedia95
    Voidmedia95
    Participant

    Hi. Could you please assist. We have Ajax Search pro installed on our website. The website is a collection of videos which have a title and tags against each of them. The search function is therefore used when someone wants to specify what they are looking for such as a ‘castle’.

    As there are many ways that you can name something we want to add synonyms and relax rules around what it picks up. Could you please assist. Two scenarios for example include:
    (1) If ‘castles’ (i.e. the plural) then it does not recognise the word – we would like it to treat ‘castle’ and ‘castles’ as the same

    (2) Is it possible to import a large list of synonyms for the entire dictionary. Eg. so we can populate forest, jungle, woods, wooland to pick up all the same. Is there a mass import function that we can do this and do you have the data? And can wordpress handle if we import the entire dictionary or are there any limits for performance?

    If you could please help with best practice that would be appreciated.

    THanks
    Kyle

    #26648
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Kyle,

    1. There is a custom code you can try, when using the index table engine. It is very far from a good solution, but it should work for most cases. You will have to put this into the functions.php file in your theme directory, copied from line 4. Make sure to have a back-up first. Then re-creating the index table will trigger this function.

    2. Well, there is an export/import function on the synonyms tab, but that is more for internal use. You would have to convert the file into the correct format (JSON).
    It might be easier to look at the asp_synonyms database table, and do the import there directly.
    I am not sure about the performance implications though, as it may get very very slow. Each keyword has to be compared to that table, and it is done in PHP for the best possible speed. There is a hard limit set in the code to allow 15000 synonyms total, but even that number could potentially cause a failure. It is very much server dependend – if the PHP memory limit is high enough (512M+), it could actually work.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #26683
    Voidmedia95
    Voidmedia95
    Participant

    Thanks Ernest, we will look into it and come back to you if we have any queries.

    Separately could you confirm if there is a way to extract all the keywords that has been aggregated in the index. Say export them to excel?

    Thanks
    Kyle

    #26697
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Kyle,

    Only via the database. PhpMyAdmin database manager usually have great tools to get structured data from a database table. The index table name is “wp_asp_index”.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #26795
    Voidmedia95
    Voidmedia95
    Participant

    Thanks i will try that out.

    Regarding the code you recommended entering above in the functions.php file (#1 above). We have tried and it doesn’t seem to have helped. If we use the castle example again when i type in ‘castles’ it is still not working.

    If you could please take a look at the site: https://voidmedia.co/
    There are videos tagged with castle, holiday, beach.
    But if i search castles, holidays, beaches.. none come up.

    Thanks
    Kyle

    #26796
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    Have you re-created the index table? Is the index table search enabled?
    If so, then I honestly don’t know. The code should handle those pluralizations.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #26903
    Voidmedia95
    Voidmedia95
    Participant

    Hi Ernest. So we are still having no luck. We have asked our theme support and they say it should work if we put it into the child theme (our theme has both a parent and child theme), which we have done. I attempted to attach the functions php file that we have put the code in to maybe see if you could spot something obvious. But it did not let us submit.

    We are not getting an error message when the code is in the child theme, it is just not working. Are you aware of any other functions that potentially supersede the code and stop it working?

    Thanks again, we appreciate the help.
    Kyle

    #26919
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Kyle,

    Interesting. One important thing I forgot, does this happen to the live search or when redirecting to the results page?
    Can you please try both? If there is a difference between the live results and the redirection, then that could indicate a search override issue instead.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #26922
    Voidmedia95
    Voidmedia95
    Participant

    Hi Ernest.

    It looks to be an issue in both situations, but we normally do not have live search enabled. See attached for the scenarios for both. In the search page scenario i have searched for the plural “castles”.

    Does that give anymore clues as to the issue?

    Thanks
    Kyle

    Attachments:
    You must be logged in to view attached files.
    #26947
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    I still feel like the index table engine is not triggered, but I don’t know why.
    Can you arrange temporary FTP and back-end access? With that I think I could tell easily.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #27305
    Voidmedia95
    Voidmedia95
    Participant
    You cannot access this content.
    #27307
    Voidmedia95
    Voidmedia95
    Participant
    You cannot access this content.
    #27332
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #27356
    Voidmedia95
    Voidmedia95
    Participant
    You cannot access this content.
    #27378
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Thank you! I think I managed to resolve it. There was indeed an issue with the script not running correctly. Now I am seeing almost double the keywords.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 15 posts - 1 through 15 (of 17 total)

You must be logged in to reply to this topic.