I have a relationship field listing all the pages of our website. We have more than 5,000 pages, and when we search using the lookahead field at the top of the relationship box, we often get many pages that are not relevant to the search string we type. It would be great if we could extend the field to search by post/page ID. I’ve tried to hook into this filter
I’m not sure what issue you’re trying to solve. Can you give a better explanation of what you’re trying to do? I understand what filter you’re trying to use but your first paragraph does not make any sense to me.
The first paragraph makes complete sense to me. I’m having the exact same issue. I need to search by post_id or post_title instead of the whole post content. Currently the search returns a whole lot of irrelevant results. Judging by the number of issues in the forum talking about relationship search being broken I think ACF should focus on fixing this asap.
Searching by anything other than post title/content in WP is difficult. ACF basically uses the built in WP admin search the same way that WP uses it when, for example you search for posts on the list of posts. You can’t just add the post ID into the s argument and expect this to work.