A Participants Database Add-On providing two different configurable multiple-field search capabilities.
Product Setup
The Combo Multisearch Plugin offers two main search control types: a single text input (like a search engine) or a set of selectors/checkboxes/text fields that provide a search term for each field. Both search types may be used, but in most cases, you’ll be using one or the other.
Setting up the Combination Search
Combo Search provides a single-input search that will look in multiple fields for a match to a single input. Use this search type in situations where a simple easy-to-use interface is desired to search the database.
To set up the Combo Search, you’ll need the names of all the fields you want searched with the user’s input. Type the names as a comma-separated list into the “Combination Search Fields” setting. To disable the combo search, leave the setting blank.
The “label” and “placeholder” settings give you two ways to prompt the user. The “label” is shown alongside the text input, and remains visible when the user types in their search. The “placeholder” is shown inside the text input, and disappears when the user begins to type in a search. A placeholder is good when you don’t need to explain much and want a clean, simple interface. The label is good for situations where you want to explain a little bit what the search is for. You can use either, neither, or both if you want.
Combo Search Modifiers
The “combo search modifiers” are a set of radio buttons to allow the user to set the type of search desired: “any,” “all,” or “phrase.” When enabled, these radio buttons will be shown next to the combo search input. There is a default search type that will be initially selected, and this is also the search mode that will be used if the combo search modifiers are not shown.
Autocomplete
“Autocomplete” is also known as “autosuggest” and provides the user with a list of suitable search terms. The list of suggested search terms is shown as a pop-up window when the user begins typing, and the list is pared down as the user types in more letters. The list of autosuggest words is drawn from the database, so it can reliably guide the user to search terms that will yield results. The fields that the autocomplete terms are drawn from is defined in the “Combo Search Autocomplete Fields” setting. It is a list of field names like the “combination search fields” setting. This means that the combo search can search on fields that don’t contribute to the autosuggest. This is helpful in cases where some of the fields searched contain blocks of text, which could add a lot of useless terms to the autosuggest list.
The terms that are available to the autosuggest are limited by the list shortcode filter, so data from records that are prevented from getting displayed won’t show up in the suggestion list.
Configuring the Multi Search
Multi Search provides a comprehensive interface for searching on multiple fields using a separate input for each field. This is best for situations where a precise, complex search is needed (such as a technical database) or in situations where you want to show the viewer what kind of information they can search by (for example, a services directory).
Starting with version 2.0, the multisearch fields are defined in a special interface under the “Multi Search Fields” tab in the plugin’s settings. In this new interface, each field in the multisearch can be customized in several different ways, changing how it looks, how the user may interact with it, and how it finds matches. Which options are available to a field depends on the type of field it is as defined in Participants Database.
If you already had Combo Multisearch set up and are updating from an older version, your fields will still be configured as before, only now you can fine-tune how each field works.
On this page, you configure which fields will appear in the multisearch and in what order. The display shows a list of all the fields configured for the Multi Search so you can edit the parameters of each one. You can add as many fields here as you want, you can also also delete and re-order them.
Note that fields that are included in the Combo Search configuration are not available for Multi Search; remove them from Combo Search to make them available in the “Add Field” selector.
Field Parameters
Each field in the list of fields has its own parameters where you can change how it is presented or how it works. There are several parameters, and which ones are available to each field depends on the field type. Here is a description of the parameters:
- Label – This defaults to the normal field title, but if you want to give it a different label in the search interface, you can do that here.
- Help Text – defaults to the field’s help text, but you can choose a different help text for the search interface.
- Attributes – allows the addition of HTML element attributes, such as the “required” attribute to selectively make fields required in the search interface.
- Input Type – depending on the original field type, there will be several different ways the field can be shown in the search interface.
- Include Label in Result Summary – when checked, the field’s label will be shown along with the searched-for value in the search result summary.
- Database Values in Selector – for any kind of selector input type, instead of showing the configured field options, the options shown in the control will be drawn from the database.
- Show “Any” Option – for selector input types, enabling this shows an option that will match any value in the database: this is essentially a “reset” for the selector, removing it from the search. Uncheck this if you want to force the user to make a selection.
- “Any” Option Label – when the “any” option is shown, this is how it will be labeled. You can leave it blank for a blank option.
- Multiselect “Or” Mode – (only for multiselect input types) if this is checked, the search result can match any of the values selected, instead of needing to match all of them when using “filter” mode. This setting makes no difference when not using filter mode because the values will be treated as an “or” in that case anyway.
Multi Search Field Input Type
Some field types will have several options available for the “Input Type” selected in the Multi Search Fields interface. A text field can be shown as a text input (of course) but also as a dropdown selector that shows a list of values taken from the database entries. Dropdown fields can be shown as a dropdown or as a multiselect, giving the user the ability to select several possible matches for that field.
Determining Which Multi Search Fields are Shown
Normally, a list shortcode configured to show the Combo Multisearch control will show all the fields you have configured in the Multi Search Fields interface. It is possible to determine on a per-shortcode basis which fields will be shown in the interface, as explained in the “Showing the Search Control” section. If you want to do this, you must configure all the fields you will show in all shortcodes, and then use the “search_fields” attribute in the shortcode to determine which of the configured fields to show in that particular display. In other words, you cannot add a field in the shortcode that has not been added to the Multi Search Fields configuration.
Filter Search Mode
The Combo Multisearch has two general modes of operation: Filter Mode on or off. With filter mode “on,” all chosen search values must match the record’s values for it to be included in a search result. If filter mode is “off,” a record will be included in the results if any of the provided search terms matches the record’s values.
When filter mode is on, any multi search fields that are configured with the “multiselect or” option will only require that one of the selected values in that field is a match. With “multiselect or” deselected, all the options selected for that field in the search must match.
Each search type, combo or multi, has a “Whole Word Match Only” switch so that text searches will only match a complete word in the search, not portions of a word. For multi-search controls, this only affects text inputs where the user types in the search term.
Searching on Date Fields
“Date” type fields can be presented as a single input or as a range with two inputs.
When using a single input, the search will attempt to include all records that correspond to the entered date.
When using the ranged inputs, the range will always include the date entered for the end of the range. For example, if the range is entered as “June 1, 2020” through “June 10, 2020” records that have a date of June 10, 2020 will be included in the result.
Partial Dates Supported
When using “date” fields in multisearch, it’s possible for users to enter partial dates, such as just the year, a month and a year, or just a month. For example “2010” will return all results with dates within that year. Entries like “March 2010” would return all dates within the month of March 2010. It’s als possible to enter a month: an entry of “May” will return all records with dates that are within the month of May in the current year. Partial dates can be used with ranged searches also: for example a search of “2000” through “2010” will return all dates between 2000 and 2010, inclusive.
When using a ranged input, if one of the inputs is left blank, it is assumed to be the current date. You can override this behavior by adding “required” to the attributes setting for the date field in the multisearch fields configuration.
Returning to the Search Results
Under the General settings tab is an option to enable restoring the previous search when returning to the search page. This is convenient for users who need to navigate away from the search page and wish to return to the same page of results. If this is unchecked, the search page will be reset every time it is loaded.
Showing the Combo Multi-Search Control
The Combo Multisearch Add-On provides its search capabilities through the use of a special template. There is a template for the list display and for the stand-alone search display. Once the plugin settings are defined, the template must be called in the shortcode like this:
[pdb_list template=multisearch ]
The plugin now also includes a table-less responsive template for the list multisearch shortcode:
[pdb_list template=multisearch-responsive ]
Or for the standalone search like this:
[pdb_search template=multisearch ]
If you are using the pdb_search shortcode, be sure to read Using the Search Shortcode as it can be tricky to configure.
It is possible to define the list of multisearch fields to search in the shortcode, drawn from the list of fields configured in the mutisearch fields setup. For example:
[pdb_list template=multisearch search_fields='company,city,state']
If you have both combo and multi searches configured, the combo search will only show if “combo_search” is included in the field list.
If you want a particular shortcode to show the combo search only, you can set that up like this:
[pdb_list template=multisearch search_fields='combo_search']
It is not possible to determine which fields are included in the combo search in the shortcode due to search optimization.
Setting Up a Remote Search
If you need to have the search control in a different location then where the results are displayed, you can do that with the [pdb_search] shortcode. You need to use the “target_page” attribute to tell the search shortcode where the results are to be displayed. The [pdb_list] shortcode is used to display the results. (Check this page for more on using the search shortcode…) For example, if your results are displayed on a page named “listings” then your search control shortcode will be like this: [pdb_search template=multisearch target_page=listings]
. That shortcode can be placed anywhere. If you want to put it into a sidebar widget, you’ll need a plugin that will allow a shortcode in a widget. Then, on the “listings” page, put [pdb_list]
. There is no need to set the template to multisearch unless you want another search control to appear at the top of the results.
Target Instance
In cases where the [pdb_list]
shortcode is on a page with other Participants Database shortcodes, you may need to set the “target_instance” attribute to target the specific list shortcode where you want the results to appear. To find the target instance value, you must inspect the HTML. At the top of the list display, you will see a classname in the wrapper such as “pdb-instance-2” That means the list is instance 2, and you would need to put that value as the target instance in the search control shortcode, like this: [pdb_search template=multisearch target_page=listings target_instance=2]
.
F.A.Q.
Can I use both the Combo Search and Multi Search at the same time?
Yes, you can, but the set of fields selected for the Combo Search Fields should be different than the fields configured in Multi Search Fields. It will still work, but the results might not be as expected because the combo search will override the multi search if both are searching on the same field.
Is it possible for the user's last used search to be restored when they return to the search page?
Yes, there is a setting under the “General” tab in the Combo Multisearch settings called “Remember the Last Search” and if checked, it will store the search parameters for the last search on the user’s browser. This means that even if they leave the site and come back later, the last search they used will still be there. If “Clear” is clicked the stored search is erased.
I want to pre-load the search terms when linking to the search page. How do I do that?
Yes, it is possible to place the search terms in the URL, and they will pre-load into the search form.
For Multi Search, each field you want to preload a search term into needs to be named and given a value. For example, you want to take the user to the search page set up to find all the brewpubs in Seattle. Your link would look something like this:
https://xnau.com/search/?city=seattle&business_type=brewpub
The “city” and “business_type” fields would then be filled with the vales in the URL. Of course, the fields named must be configured to appear in the Multi Search inputs.
You can do the same for the Combo Search, but there is only one field, named “combo_search” so if you wanted to do the same kind of thing as our example above, you could use a URL like this:
https://xnau.com/search/?combo_search=seattle%20brewpub
You’ll notice the %20 in the search term: this is code for a space, this is needed because URL’s cannot contain spaces. Take a look at this reference to learn more about using query strings in URL’s.
I want to combine Combo Multisearch with Locations Map to show search result locations in the map. How can this be done?
Right now this doesn’t work using the “auto placement” of the locations map. You can get it all working together using a custom template I’ve created a template that will do the job here:
https://gist.github.com/xnau/39afbf647d78e85a7acdba4b0da30530
You’ll need to download that template, and place it where Participants Database can find it. This is explained here:
Using Participants Database Custom Templates
Once that’s done, change your shortcode to something like this:
[pdb_list template=multisearch-map]
I've got a very large database, are there any problems with this plugin with large databases?
Mostly, the size of the database is not going to matter at all, MySQL is pretty efficient with large databases.
There is one setting that will be affected, that’s the “Autocomplete” feature of the Combo search. For a very large database, you could get some memory errors with this feature. Two things you can try for that problem: limit the number of of fields that are going into the autocomplete (using the “Combo Search Autocomplete Fields” setting) which will cut down on the number of terms loaded into the autosuggest. Second, if your database is realy, really large, you may need to turn autocomplete off altogether.
If you are concerned with database performance issues, it’s a good idea to tune your server for better performance. You may want to ask your web hosting provider about that, it is a fairly technical subject and requires server configurations you may not have access to.
Morning;
Is it possible to setup dropdown filters in which you could select a Country followed by a County to display results? I read through the documentation and understand the premise however I could not find a demo and wanted to make sure before purchase.
You can have both selectors in the search form, however there is no provision for limiting the choices based on another choice: for instance the “county” dropdown would show all the counties, regardless of what was selected in the “country” selector.
The choices can be organized by groups, that is the best it can do at the moment.
Hi Roland — How do I control when and where my search values are returned? I’ve set up a search using the stand-alone [pdb_search template=multisearch ], and when I execute a search I don’t see any returns. If I incorporate the [pdb_list template=multisearch ] then the entire database appears on the page before I execute the search. Thanks for your help.
Hi John,
If having the result appear just below the search form works for you, you can use the “suppress” attribute of the list shortcode to prevent anything showing until a search is performed:
[pdb_list template=multisearch suppress=true]
If you want to have your search results show up on another page or something, take a look at the instructions for using the search shortcode.
Thank you for the quick reply, Roland. This looks like exactly what I need to read through.
Hi Roland,
Thank you for your help I was able to create a custom template with clickable images.
But I would like the links to open in a new tab.
On this page http://v1.honoryou.client.tagonline.com/memorial-garden-2/
How can I achieve that ?
Thanks,
Aditya
That can be done, but I have not set up any kind of elegant way to do it. You just need to set up a simple string replacement to add the target attribute.
The template has a method for showing the field value. In your case, that is an image with a link. In the template, that will probably look like this:
What you need to do is do a string replacement to add the attribute. Remember, this may be applied to all fields, so you may need to include some logic so that it’s only done on the chosen element.
The string replacement should look something like this:
The “false” value in the print_value method is to keep it from printing so we can alter the HTML, then echo it.
Hi Roland,
For some reason 2 GET requests are generated through plugin for one is from the user ‘s browser which is OK and the second is from the web server which bothers me. I would like to know what is causing the plugin to generate the GET request from the web server and how to fix it.
One more thing do you have documentation on PDb_FormElement which is used in the pdb-list-responsive.php template.
Thank You
Aditya
The plugin, like all WP plugins, performs a periodic get request to check for updates. Participants Database performs an additional get request to update the “live notifications,” which provides content to the ad panel in the backend.
I don’t have documentation on the PDb_FormElement class specifically, only some general documentation on the API. The class file is inline documented which may be helpful.
Is there a way to disable the “periodic get request” as we are not using the any kind of “live notifications” ?.
Contact me at support@xnau.com and I will provide the information your require. This is currently in the works for the next major release.
Hi Roland,
I’d like to make the photos on this page clickable and set to a custom URL (clicking on the image for each listing should open up a PDF).
The template I am using is pdb-list-responsive.php. I would like to know how I can wrap the anchor tag used for “View PDF” around the images in the page below.
http://www.honoryou.com/memorial-garden/
Thank You,
Aditya
Hi Aditya,
Something like this will require a custom template. If you’re comfortable with some PHP, it’s not too difficult. If you look at this article, Adding an Edit Record Link to the Frontend List, that will give you the basic technique. What you need to do to your image fields is essentially the same: set the “link” property of the field object to the URL you want to use.
Hi Roland,
How can I add pagination to my list display?
http://www.honoryou.com/memorial-garden/
I currently have 36 records being displayed. I’d like to add “previous” and “next” arrows to navigate through the remaining entries.
I see some mention of AJAX Pagination & Sorting here:
https://xnau.com/work/wordpress-plugins/participants-database/participants-database-1-6-whats-new/
Can you please clarify this for me?
Thank you very much,
Greg
Hi Greg,
Pagination happens automatically if there are more records than the “Records per Page” setting (plugin settings under the list tab)
but it looks like you have it hidden in your child theme stylesheet
.home-boxes .pdb-list .pagination, .pdb-pagination {
clear: both;
display: none;
}
Hi Roland,
Thanks for this. That CSS was supposed to only effect the Home page. The pagination is now showing up but when clicked on, no records are loading. Just a blank space:
http://www.honoryou.com/memorial-garden/
Any thoughts?
Thanks,
Greg
I opened the page, tried the pagination, it’s working for me. Did you fix the problem?
Hi Roland,
Thanks for all your help so far. I have one more question!
I’ve used the CSV import feature to upload the data but I’m having an issue with Link Text. In the CSV file, I’ve dedicated a column to the PDF paths in order to link to them. However, when I edit a single listing, I’m able to specify not only the link URL, but also the link text. You’ll notice the first row of entries have “View PDF” as the link text, but the rest beneath are displaying the link itself:
http://v0.honoryou.client.tagonline.com/memorial-garden/
How can I tie together the link URL and the link text in my CSV file?
Any help is greatly appreciated.
Thanks,
Greg
I know this little tidbit is hard to find, but since a CSV can only contain text, we use “markdown” to import and export link fields, like this:
[Link Text](http://domain_name.tld)
This is detailed in this article: Importing an Existing Database into Participants Database
Hi Roland,
I’m having some trouble setting up the combo multi-search plugin:
http://v0.honoryou.client.tagonline.com/memorial-garden/
Basically, what I have currently are two separate shortcodes:
[pdb_search template=multisearch ]
[pdb_list template="responsive"]
I need the list output to use the responsive template, but I need the search field to use the multi-search. As I understand, these two shortcodes are not currently linking together. Can you please shed some light on how I can accomplish this?
Thank you,
Greg
Hi Greg,
I don’t really do a good job of explaining how to do this in the documentation, but when you are using the [pdb_search] shortcode and the [pdb_list] shortcode on the same page, you need to tell the search shortcode to target the list. Every instance of a Participants Database shortcode on a page has a unique index (this is so you can have multiple lists on a page for instance) the list in your case will probably have an index of ‘2’ since it is the second PDB shortcode on the page. You can verify this in the HTML by looking at the “div” container for the list, the index number will be in the class name as “pdb-instance-2”
To tell the search shortcode to target that list, you need to use the “target_instance” attribute like this:
[pdb_search target_instance=2 template=multisearch ]
Thank you Roland. That was much easier than I was expecting!
I actually have one more question for you if you don’t mind. I’d like to make the photos on this page clickable and set to a custom URL (clicking on the image for each listing should open up a PDF). I don’t see how to accomplish this in the settings or in the documentation. Any ideas?
http://v0.honoryou.client.tagonline.com/memorial-garden/
To do this sort of thing, you need to use a custom template. I wrote an article on how to set up a “record edit link” on the list using a custom template. The technique you would use is exactly the same, only you’ll be putting your link on the photo field. If you know a little PHP it’s not hard.
Adding an Edit Record Link to the Frontend List
Roland,
If you wouldn’t mind looking at this page. I have been unable to get the filter mode where it will allow a person to search by first or last name and pull a result, even though the person is in the database.
http://www.csems.org/approved-regional-preceptor-list/
Any advice would be appreciated.
Chad
Hi Chad,
It looks like you’ll need to adjust the search configuration. Make sure the combo search fields setting has the names of your search fields, it will probably look like this:
first_name,last_name
If that still isn’t working, I’m not sure what the problem could be at that point.
Setting up the autocomplete might help…put those field names into the autocomplete fields, and enable auto complete.
I see the problem, not sure what’s causing it. Could be the session cookie is not getting saved, so the search never completes.
I suggest you uncheck the “Enable AJAX Search Functionality” setting under the advanced tab, that will bypass the need for the session.
How does one turn the filter mode off or change the result level to number 4 for combo searches?
Hi Chad,
I understand it’s not too clear, but the global filter mode is changed under the “general” tab in the plugin settings. “Search Modifier” refers to the “Default Search Modifier” setting (unless you’re letting your users select that)