This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

How to make custom fields searchable

Home Forums Product Support Forums Ajax Search Pro for WordPress Support How to make custom fields searchable

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #27473
    timburkarttimburkart
    Participant

    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.

    #27491
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi!

    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
    That offers selectable, searchable values.

    #27495
    timburkarttimburkart
    Participant

    Hello 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.

    #27502
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    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.
    I also suggest adding a Search button to the filters – because hitting return on the text field will not trigger a redirection.

    #27510
    timburkarttimburkart
    Participant

    Thank you, Ernest! I have made the necessary search changes.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.