Issue with Sorting
-
Great work however in debugging the sort order I can see the query and there is NO SORT ORDER! You build the priority but NEVER use it.
I used this to see your query
add_filter( ‘relevanssi_query_filter’, ‘rlv_check_mysql’ );
function rlv_check_mysql( $query ) {
var_dump( $query );
exit();
}`<strong>There should be a
ORDER BY tf DESC;</strong>SELECT DISTINCT (relevanssi.doc), relevanssi.*, relevanssi.title * 5 + relevanssi.content * 1 + relevanssi.comment * 0.75 + relevanssi.tag * 0.75 + relevanssi.link * 0 + relevanssi.author + relevanssi.category * 0.75 + relevanssi.excerpt + relevanssi.taxonomy + relevanssi.customfield + relevanssi.mysqlcolumn AS tf FROM wp_relevanssi AS relevanssi WHERE ( relevanssi.term LIKE 'bandage%' OR relevanssi.term_reverse LIKE CONCAT(REVERSE('bandage'), '%') ) AND ( (relevanssi.doc IN ( SELECT DISTINCT (posts.ID) FROM wp_posts AS posts WHERE posts.post_type NOT IN ( 'product_variation' ) ) ) OR ( doc = - 1 ) )
The page I need help with: [log in to see the link]
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Issue with Sorting’ is closed to new replies.