Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make a search in ACF custom field value #37

Open
elron opened this issue Dec 11, 2022 · 2 comments
Open

Make a search in ACF custom field value #37

elron opened this issue Dec 11, 2022 · 2 comments

Comments

@elron
Copy link

elron commented Dec 11, 2022

I want to perform a search query for a custom post type (poems, similar to posts), and search in the value of the field "text_to_index".

For example, a poem (post) could have "text_to_index" custom field, with this value:
"Please feed the cats"

I want to be able to search "cats" and retrieve the relevant poem node.

{
  poems(where: {search: "cats"}) {
    nodes {
      id
      title
      content
    }
  }
}

Currently, the above query only searches in "title" and "content". I need it to search in the value of ACF custom field.

How do I do that?

@ShahriarKh
Copy link

@elron Did you find a solution?

@elron
Copy link
Author

elron commented Feb 21, 2025

I did not
I used regular SQL query, also its much faster

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants