Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Custom Fields Weighting
This topic contains 3 replies, has 2 voices, and was last updated by Ernest Marcinko 4 years, 6 months ago.
- AuthorPosts
- November 8, 2018 at 1:11 pm #19854
Hello,
I would need to weight custom fields. I am using the search for a glossary. So my posts have e.g. Abbreviations and Synonyms as custom fields.
So for example in case a Synonym were an exact match I would that ordered before results were the same match is only in the content.
How can this be done?
Michael
November 8, 2018 at 3:00 pm #19860Hi Michael,
For performance reasons the custom field weight is disabled for the regular engine. There are two possible options in this case:
1. Is to use the index table engine, however it is worth noting, that exact matching multiple keyword phrases (aka the whole field as one) is not possible, only separate whole words. This documentation can help you set up the index table, and then under the relevance options you will be able to change the custom field relevance to a much higher value.
2. To make a direct modification to the regular search file to enable custom field matching relevance. To do that, you will have to
Best,
– Open up the wp-content/plugins/ajax-search-pro/includes/classes/search/class-asp-search-cpt.php file on your server
– and replace it’s contents with this.
Please make sure to have a back-up of everything, before making direct changes. This change unlocks the custom field relevance query, and increases the result relevance, when a match is found within the choses custom fields. (chosen under the General Options -> Sources panel)
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 15, 2018 at 10:15 am #19946Hi Ernest,
I replaced the content as specified by you. I assume that I should see a new column in the relevance tab. But nothing changed see screenshot. Or am I looking in the wrong place?
Best Michael
Attachments:
You must be logged in to view attached files.November 15, 2018 at 10:17 am #19948Hi,
Make sure that the index table engine is indeed activated. Otherwise the other tab will stay disabled.
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.