Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Ordering result article numbers
This topic contains 1 reply, has 2 voices, and was last updated by Ernest Marcinko 6 years, 10 months ago.
- AuthorPosts
- October 27, 2017 at 9:07 am #15300
Hi, the product search I set up for this page (start page and “produkter”) works ok, but we have discovered an issue. When you search for a article number (for example 201120) the result shows the product with the exact article nr last in order. Can’t understand the logic in that article numbers with addons for example “201120-96A-40” is listed at the top and “201120” is listed last – the most exact number should be first in my book. How to achieve this, can you help me?
October 27, 2017 at 10:14 am #15303Hi,
Thank you for the details. I have checked the configuration, and both the primary and secondary ordering is set to by ‘relevance’ as default. However you want to order the results by ‘_sku’ as well as relevance.
I have made the following changes:
– Secondary ordering set to ‘_sku’: https://i.imgur.com/UCd8xQe.png
– Custom field relevance set to 0: https://i.imgur.com/3GmmPF6.pngExplanation
This is sort of a strange configuration at first, but it should do the trick. By changing the custom field relevance to 0, the _sku fields do no longer affect the primary ordering (the relevance itself). But since ‘201120’ only matches the ‘_sku’ field, the primary ‘relevance’ ordering has no effect, as all items have the same relevance. Because of that, the secondary ordering is used, which re-orders the results by the ‘_sku’ field.This should more likely give you the expected ordering in most case, however it is not perfect by any means.
I hope this helps!
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.