@mateuszgbiorczyk – Sorry it has been so long, but I had to work on something different and now I’m back on the original project that was using the plugin. So I have now added your debug code and get the output and this is the query I got:
SELECT DISTINCT SQL_CALC_FOUND_ROWS
wp_10_posts.*
FROM wp_10_posts
INNER JOIN wp_10_postmeta AS a ON (a.post_id = wp_10_posts.ID)
INNER JOIN wp_10_postmeta AS b ON ((b.meta_id = a.meta_id + @@auto_increment_increment)
AND (b.post_id = wp_10_posts.ID))
INNER JOIN wp_10_posts AS c ON (
(c.post_type = ‘acf-field’)
AND (
(c.post_content LIKE ‘%:”text”%’)
OR
(c.post_content LIKE ‘%:”textarea”%’)
OR
(c.post_content LIKE ‘%:”wysiwyg”%’)
)
)
WHERE 1=1
AND (
(
(
c.post_name = b.meta_value
)
AND
(
a.meta_value LIKE ‘%test%’
)
)
OR (
(
wp_10_posts.post_title LIKE ‘%test%’
)
OR
(
wp_10_posts.post_content LIKE ‘%test%’
)
OR
(
wp_10_posts.post_excerpt LIKE ‘%test%’
)
)
)
AND wp_10_posts.post_type IN (‘post’, ‘page’)
AND (
wp_10_posts.post_status = ‘publish’
OR
wp_10_posts.post_status = ‘acf-disabled’
OR
wp_10_posts.post_status = ‘private’
)
ORDER BY wp_10_posts.post_title LIKE ‘{f2430de4ac2e5caa5885164f7569b233c8de81e5f12374f72f76a9dd2e55e406}test{f2430de4ac2e5caa5885164f7569b233c8de81e5f12374f72f76a9dd2e55e406}’ DESC, wp_10_posts.post_date DESC
LIMIT 0, 10
It appears to be referencing the correct tables, e.g. the _[site-number]_ tables, so I’m not sure why it isn’t working.