Advanced search form with multiple custom fields

admin2025-01-08  6

I'm working in a site that allows to search for lawsuits about medical malpractice, the client wants to have a search form almost equal to the one in this site:

/

All the information is stored in custom post types with custom fields, including the lawsuit, hospital and the doctor record.

I looked around for plugins but most of the advanced plugins I found are for custom taxonomies filters and not custom fields and some have the ability to search in custom fields but with only one input in the form instead of separated inputs for each possible field to search.

Is there a plugin that can achieve this layout and behaviour? If there is not what could be my best approach in creating this search form? I have never modified the wordpress search before.

We are using advanced custom fields plugin.

I'm working in a site that allows to search for lawsuits about medical malpractice, the client wants to have a search form almost equal to the one in this site:

http://psychcrime.org/database/

All the information is stored in custom post types with custom fields, including the lawsuit, hospital and the doctor record.

I looked around for plugins but most of the advanced plugins I found are for custom taxonomies filters and not custom fields and some have the ability to search in custom fields but with only one input in the form instead of separated inputs for each possible field to search.

Is there a plugin that can achieve this layout and behaviour? If there is not what could be my best approach in creating this search form? I have never modified the wordpress search before.

We are using advanced custom fields plugin.

Share Improve this question asked May 7, 2018 at 21:20 jerukijeruki 1014 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Custom fields are stored in post metadata, which is very expensive (slow) to query. Ideally, you would be better off re-coding the site to use custom taxonomies instead of custom fields. From there, search would be easier.

If you stick with ACF or other metadata, you can customize the search form and queries, but you'll be putting a lot of load on the server. At that point, it would be preferable to add a search service such as ElasticSearch or Swiftype. The client would pay for this monthly or annual service, but they'd be able to do all sorts of filtering and sorting without as much custom code, and everything would load much faster because you would then be querying an external service rather than the WP database.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1736267531a1203.html

最新回复(0)