Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › How to make custom fields searchable
This topic contains 4 replies, has 2 voices, and was last updated by timburkart 3 years ago.
- AuthorPosts
- May 21, 2020 at 1:40 am #27473
Hello!
I setup a search to include various custom fields.However if I try to search for something by only entering a value in a custom field nothing happens. For example, I would like to search for all posts with Rayan as one of the authors. If I type Rayan in the Author text box and either hit enter or click on the magnifier nothing happens. Why is that? How can I make these custom fields work like the search bar?
Thank you.
May 21, 2020 at 1:24 pm #27491Hi!
The text input field does not pre-populate anything unfortunately, the users can enter anything they want. Perhaps using a drop down filter, that is searchable might be a better option to consider: https://i.imgur.com/nRdm3My.png
Best,
That offers selectable, searchable values.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
May 21, 2020 at 3:11 pm #27495Hello Ernest,
Yes, I know that users can enter anything in a text field. That is what I want. In a database with 2600 posts it is not practical to create a drop down list for authors or publishing institutions.
My question is how do I make the text fields behave like the search bar? I want a user to be able to type something in one of the text fields and press enter to search only in that custom field. For example, I have a custom field called author so I want a user to be able to enter an author name in the corresponding text field and press enter to search only the author custom field. The problem is, nothing happens when I only enter data in the text field. The search mechanism requires data to be entered in the search bar too.
I hope this clarifies my problem.
Thank you.
May 22, 2020 at 9:04 am #27502Hi,
Sure, I understand now. You can lower the required character count to 0 here. That will let the search to trigger on 0 characters entered as well.
Best,
I also suggest adding a Search button to the filters – because hitting return on the text field will not trigger a redirection.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
May 22, 2020 at 10:00 pm #27510Thank you, Ernest! I have made the necessary search changes.
- AuthorPosts
You must be logged in to reply to this topic.