Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Synonyms implementation
This topic contains 16 replies, has 2 voices, and was last updated by Ernest Marcinko 3 years, 6 months ago.
- AuthorPosts
- April 7, 2020 at 10:17 pm #26645
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
KyleApril 8, 2020 at 9:24 am #26648Hi 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).
Best,
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.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
April 12, 2020 at 10:55 pm #26683Thanks 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
KyleApril 14, 2020 at 9:59 am #26697Hi 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 :)
April 17, 2020 at 1:12 pm #26795Thanks 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
KyleApril 17, 2020 at 1:22 pm #26796Hi,
Have you re-created the index table? Is the index table search enabled?
Best,
If so, then I honestly don’t know. The code should handle those pluralizations.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
April 25, 2020 at 5:09 pm #26903Hi 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.
KyleApril 27, 2020 at 12:18 pm #26919Hi Kyle,
Interesting. One important thing I forgot, does this happen to the live search or when redirecting to the results page?
Best,
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.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
April 27, 2020 at 12:43 pm #26922Hi 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
KyleAttachments:
You must be logged in to view attached files.April 28, 2020 at 7:39 am #26947Hi,
I still feel like the index table engine is not triggered, but I don’t know why.
Best,
Can you arrange temporary FTP and back-end access? With that I think I could tell easily.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
May 13, 2020 at 6:55 pm #27305You cannot access this content.May 13, 2020 at 8:14 pm #27307You cannot access this content.May 14, 2020 at 2:04 pm #27332You cannot access this content. Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
May 15, 2020 at 10:05 am #27356You cannot access this content.May 15, 2020 at 2:51 pm #27378Thank 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 :)
- AuthorPosts
You must be logged in to reply to this topic.