Support » Plugin: ACF: Better Search » Backend Search not searching custom fields only text area and title

  • john2230

    (@john2230)


    Hi

    when i search for a post in the backend of my site using the a custom field as the search query word it displays no results, is there a way for this plugin to search through ACF fields and not just the title and text area.

    I have ACF pro installed.

    Cheers

Viewing 7 replies - 16 through 22 (of 22 total)
  • Plugin Author mateuszgbiorczyk

    (@mateuszgbiorczyk)

    Please add this code in plugin file and try to search. You see a SQL query. Please, send me his contents.

    https://ibb.co/jKimTU

    Hi this is the search content

    SELECT DISTINCT wp_posts.ID, wp_posts.post_parent FROM wp_posts LEFT JOIN wp_postmeta AS a ON (a.post_id = wp_posts.ID) LEFT JOIN wp_postmeta AS b ON (b.post_id = wp_posts.ID) LEFT JOIN wp_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 (((a.meta_value LIKE ‘%eqh-94%’) AND (b.meta_id = a.meta_id + 1) AND (c.post_name = b.meta_value)) OR ((wp_posts.post_title LIKE ‘%eqh-94%’) OR (wp_posts.post_content LIKE ‘%eqh-94%’) OR (wp_posts.post_excerpt LIKE ‘%eqh-94%’))) AND wp_posts.post_type = ‘portfolio’ AND (wp_posts.post_status = ‘publish’ OR wp_posts.post_status = ‘acf-disabled’ OR wp_posts.post_status = ‘future’ OR wp_posts.post_status = ‘draft’ OR wp_posts.post_status = ‘pending’ OR wp_posts.post_status = ‘private’) ORDER BY wp_posts.menu_order ASC, wp_posts.post_title ASC

    Hi

    Are you still looking into this issue?

    Cheers

    Plugin Author mateuszgbiorczyk

    (@mateuszgbiorczyk)

    I need your database dump to testing it (only table wp_posts & wp_postmeta).

    Any resolution?

    I have a custom field with an ID field (text) and when I search on the admin side, it doesn’t find anything.

    Plugin Author mateuszgbiorczyk

    (@mateuszgbiorczyk)

    Please read post above. I cann’t help if I don’t have all informations.

    Plugin Author mateuszgbiorczyk

    (@mateuszgbiorczyk)

    According to my tests, everything works without a hitch:
    https://i.imgur.com/uhRXt3S.png

Viewing 7 replies - 16 through 22 (of 22 total)
  • The topic ‘Backend Search not searching custom fields only text area and title’ is closed to new replies.