Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Result ordering questions › Reply To: Result ordering questions
Hi,
Thank you for all the details, it helps us a lot.
The general issue with the custom field ordering in this case is, that if the field for a particular product does not exist (not set), then it defaults to “0”. And 0 is lower than 1, 2, 3… etc.. so the items with the unset field value are put to the first place. Using a custom field based ordering is rather useful when all the items can have a field value, or perhaps using a descending ordering instead of ascending may also help.
What about ordering by the _sku field? Looking at the list of the required ordering, it is basically ordered by SKU ascending. Wouldn’t that be a better way?
If that is not the case, then instead of this, I recommend the results priorities feature. It lets you set numeric priorities to each result, which sort of fixates their position when they match. It is not exactly the same as the ordering, but in your case it may actually work.