Forums › Forums › Search & Filter Pro › Relevanssi custom post type weight missing
Tagged: custom post type, relevanssi, weights
- This topic has 2 replies, 2 voices, and was last updated 4 years ago by Trevor.
-
Anonymous(Private) December 7, 2020 at 9:05 pm #269046
Hi,
I am using your plugin together with the Relevanssi-plugin. Everything is working fine except that I can not get the relevanssi custom post type weights to be included in your query. I have used Query Monitor to have a look at the query (see below). If I change relevanssi.title weight in the Relevanssi admin this is affected in the query below. Everything also seems to work fine when executing a search using the WP admin (Dashboard->Search). Am I missing anything to make the query also include relevanssi post type weights when querying using Search & Filter Pro?
Query dump from form using relevanssi_query_filter:
string(948) “SELECT DISTINCT(relevanssi.doc), relevanssi.*, relevanssi.title * 9 + relevanssi.content * 1 + relevanssi.comment * 0.75 + relevanssi.tag * 1 + relevanssi.link * 0.75 + relevanssi.author + relevanssi.category * 1 + relevanssi.excerpt + relevanssi.taxonomy + relevanssi.customfield + relevanssi.mysqlcolumn AS tf FROM wp_relevanssi AS relevanssi INNER JOIN wp_postmeta ON ( relevanssi.doc = wp_postmeta.post_id ) WHERE (relevanssi.term LIKE ‘testterm%’ OR relevanssi.term_reverse LIKE CONCAT(REVERSE(‘testterm’), ‘%’)) AND ( wp_postmeta.meta_key = ‘_thumbnail_id’ ) AND ( relevanssi.doc IN ( SELECT DISTINCT(posts.ID) FROM wp_posts AS posts WHERE posts.post_type IN (‘post’, ‘product’, ‘custom_post_type_1’, ‘custom_post_type_2’, ‘custom_post_type_3’, ‘custom_post_type_4’, ‘custom_post_type_5’, ‘custom_post_type_6’) ) ) AND ((relevanssi.doc IN (SELECT DISTINCT(posts.ID) FROM wp_posts AS posts WHERE posts.post_status IN (‘publish’))) OR (doc = -1))” -
AuthorPosts