Support

Account

Home Forums Backend Issues (wp-admin) make searching in relationship field accurate, or is it a bug ?

Solving

make searching in relationship field accurate, or is it a bug ?

  • I am using field type ‘Relationship’ to relate the post between various post-types.

    Can we make the related search more accurate, so it actually returns the post we are looking for when you search for the post by title. Also, is there a way for us to not have to type in the exact title to get the post we are looking for?

    I tried searching for iMOM Love Notes ( please see screenshot screenshot-1.png below) to list as a related resource for “10 Ways to Love Your Child” and it did not return in the results?

    Another example :

    I also tried searching for the post “23 Ways to Show Love for your husband” by typing in “show love to your husband” ( please see screenshot screenshot-2.png below) and the post didn’t’ show in the search results.

    Because there are so many posts on my site I want for the related search to work correctly and help us find the related posts that we are looking for.

    Is there any other tweaks I can do through available filter/hooks, without editing plugin, please suggest. Your any advice and suggestion would be highly appreciated.

    Looking forward to your kind response.

  • You’re not the only one experiencing this issue; my team and myself are as well.

    This issue was originally fixed in 3.40:

    [Fixed] Fix relationship search – Only search title, not content

    But it looks like it has resurfaced with the changes in WordPress 4.x. Hopefully someone on the ACF team will notice this thread.

  • We too have this problem.

    In core/relationship.php it appears that acf is using WP’s search (‘s’ parameter in a query) which searches both title and content. With hundreds of organisations having the word ‘support’ in their content it makes selecting the one organisation with title Support U in the normal way (just typing it into the search box) almost impossible in practice (though putting double quotes round the whole search term can help).

  • Hi @wen

    I am afraid I cannot replicate this on the latest version v5.3.9.1 of the Pro version.

    It is safe to assume that this was fixed on an earlier update.

  • This isn’t fixed or it’s broken again. ACF Relationship Field appears to use the default WordPress query, which searches for matches in post_title, post_excerpt, and post_content.

    Tested on stock WordPress 4.9.3 and ACF 5.6.8.

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘make searching in relationship field accurate, or is it a bug ?’ is closed to new replies.