Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Post relevance issues › Reply To: Post relevance issues
I’m sorry, we are not available for paid live support via calls. I usually answer as soon as I can, within hours when I’m online, otherwise within 24 hours.
What I think we would like to be able to do is give a relative weight to the date in order to help lift recent posts.
I see. Well, that’s not possible out of the box I’m afraid. It might be doable via some custom code, but I’m not sure how complicated it may get. It may get very problematic as you want to somehow add a weight on dates before the query is executed, and that is extremely complicated. You can potentially look at the query related hooks as well as the results hooks, but it’s not going to be that simple.
I also believe it has something to do with the fact that it is going through the database to find matches starting with the oldest entries and then moving to the most recent, because of this if it finds an old result that scores the same as a new result it is returning the old result first.
Not really. All the matches are considered the same way, and if the relevance score is the same, then the secondary ordering is used to determine the final order inbetween the the items with the same relevance. However it is very unlikely to have the same relevance score, as it computes the number of full and partial matches, they are weighed etc… It is much more likely that the relevance value comes out higher. Even a single keyword occurence will make a difference in relevance.
Instead of trying to custom code and struggle, I would rather make sure that the keyword and the relevance configuration is correct.
– By default the keyword logic should look like this, if it’s different, make sure to change it back.
– If there is no noticable difference, then try to experiment with a bit more strict variation: https://i.imgur.com/vMfYUTz.png
Then consider which field (title, content, custom fields etc..) has the most relevance in your case, and adjust the relevance values accordingly. What I usually do is go with extreme values first, then slowly increase/recuce and observe the changes.
For example, if custom field based matches are significantly more important, then I would start with this configuration: https://i.imgur.com/91RQBFg.png
You can even use 0 values to start off, to see how it looks when only a certain field is prioritized.