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.
in the Admin section, I cant seem to delete any of the listed Fields.
There is a Field that has () as the title, this is the issue.
Tried to delete plugin, reinstall still there
Any suggestions what to do?
The field title is probably not the problem, I just teste that. Take a look at your php error log, that should give you some clue as to the problem.
Hi. I posted the shortcode [pdb_list template=multisearch orderby="date_filed" search_fields="searchable_parties, offense, industry"].It used to work fine. Ever since the update, no search bar is showing up on the page. Any idea why?
I suggest you review the settings for Combo Multisearch, make sure it’s all as it is supposed to be, the update may have changed things. If that doesn’t resolve it, can you provide a link to the page so I can take a look?
WordPress : 5.3.2
OS: Linux
PHP : 7.3.14
MySQL: 5.5.62
Apache
I seem to have acquired two problems but not sure when.
a) IAm unable to add another Multi Search Field; can confirm been checked as sortable. The activity wheel just keeps spinning.
b) A dropdown menu with Option Groups only shows the first ‘Optgroup’; please see Fauna in the following: https://www.gowerbonecaves.org.uk/gazetteer
IWorks fine in Admin to add new records and in the Signup area. Not sure if this is related to what Combo Multisearch is doing. This part of what its trying to show:
null_select::Unknown, INSECTIVORA::optgroup, Common Shrew – Sorex araneus, Mole – Talpa europaea, Water Shrew – Neomys usp., CARNIVORA::optgroup, Badger – Meles meles, Brown Bear – Ursus arctos, Cave Bear – Ursus spelauys, Grizzly Bear – Ursus ferocious, Bear – Ursus sp., Dog – Canis familiaris, Fox – Vulpes ….
Any guidance greatfully received. Many thanks for recent improvements to searching.
I’m issuing an update to Combo Multisearch that fixes the issue with adding new multifields. Thanks for the report, there was a bug.
On the optgroup issue, does the problem show up only in the Combo Multisearch search control? Do the optgroups work normally when editing a record?
Thanks for that. optgroups work fine when editing records.
Have installed update but the adding new multifields problem persists. Am using Firefox but the same in Google Chrome
try doing a hard refresh, the old JS is in the cache.
I’ve issued another update to Combo Multisearch, 2.1.3, should fix the problem.
I see the problem, give me a chance to issue a fix.
Perfect! Both issues now rresolved. Many thanks for such a prompt response.
Hello.
I just purchased the add-on and I’m liking what I see, but while I see the search box for the field I’m trying it out on, it’s also displaying all 345, showing 20 per page below the search. Am I missing a setting to keep that blank and only show the results? I tried the demos and I see that it’s blank there, so I’m doing something wrong with a setting somewhere.
I use Beaver Builder, but I read that it doesn’t play nice, so I used WP’s main editor and I’m using this shortcode: [pdb_list template=multisearch search_fields='staff_id'] per the directions here. Again the search works great, but I don’t want my users to see other people’s ID and name, just allow them to see how many times they’ve logged into it for working events.
Thank you
You can use the “suppress” attribute in the list shortcode to prevent the list displaying before a search is performed.
[pdb_list template=multisearch suppress=true]
And whatever other attributes you need to use. You can control which columns are shown on the Manage List Columns page in the plugin settings.
That did it. Thank you so very much.
Hi – is there a way to filter the values in the dropdown collected from the database. I have a database of players for colleges, and the schools for basketball will be different than the schools for football. one page on the site shows the football players, the other shows the basketball players. Would like the dropdown on the search to know which sport.
Well, a good way to do this is to have a separate dropdown for each sport, then control which dropdown is used in the form in the shortcode. You can use the “search_fields” attribute to set which fields are shown in the search control.
If you can’t do that (it will be a big hassle if you’ve already got your db populated), then you can use CSS to hide the non-relevant options. To do this, you need to use optgroups to organize the options in the dropdown. Then you can target the optgroup with a CSS rule that hides it. You’ll need to figure out how to make the rules apply to the correct page.
Thanks for the reply. I thought about the 1st option – making 2 separate fields for school, a BB_school and FB_school and then picking which dropdown. I’ll also looking the CSS option.
Thanks again
I was able to make this work – https://xnau.com/dropdown-selectors-limit-selections-based-on-another-selector/
Is there a character limit in the Options in the field definitions. it is truncating my list when I save. there are 132 football schools and 113 basketball schools.
There is a limit, but it’s 4GB. Probably what’s happening is the post_max_size limit in your php configuration is getting hit.
Hello,
I have purchased the Combo Multi-Search plugin and now utilise it on my list which is for cemetery burials (over 12,000 records are in the database).
At the moment, I have it searching for a first name in the first name field, a surname in the surname field and the user can also select a range of dates to narrow down their search period.
Unfortunately, if you select a date period from when the cemetery opened and also use a * (wildcard) at both the forename and surname, you will get every record listed.
I would like to prevent the user from being able to use the wildcard in this way and perhaps also restrict the date range to say a certain number of years.
Is this possible?
Jonathan
You can prevent the use of wildcards by checking the “Whole Word Match Only” preference in the Multi-Search settings. As to limiting the dates, you can do this if you’ve got the Datepicker add-on installed, there is a configuration for limiting the dates available in the picker.
Hello Roland
Many thanks for this help. That is a better solution than someone being able to use a wildcard for every text based search field.
However, is there a way to not allow the usage of wildcards in the search boxes, but to also not need an exact field match ?
Kind Regards
Jonathan
Well, a partial word search is pretty much the same as a search using wildcards: the wildcards are just implied instead of explicit. What is it you want the user to be able to do? Enter part of a name? Enter a name without knowing the exact spelling?
Hello
I have 12000 burial records in a searchable database.
The search fields cannot be empty, otherwise someone could download every entry. Additionally using a wildcard in both the surname and first name search boxes would display all 12000 records.
Although an exact field match criteria is the best of those options, it also has a flaw.
In that I may search for a first name of JOHN and a surname of SMITH. The surname field if a database entry may be SMITH/JONES (some are like this). Using the exact field search method would Not catch this record.
This type of search requires a) not allowing searches where the search string is empty b) not allowing wildcards to be entered by the user in the search string c) not using exact search field match. Ideally the user should have to enter a minimum number of characters before search takes place too.
Kind Regards
Jonathan
This is possible, though it may require a little custom code.
The “Whole Word Match” will actually match a slashed or hyphenated name if only part of it is used as the search term. This is because a “word” is a string of characters bounded by one of several different characters that are considered word boundaries: characters such as spaces, slashes, and hyphens are used to delineate words. That setting is generally the best way to ensure that only fairly specific search terms will be successful.
It is possible to make all the search fields required, there is a setting for that in the multi-search settings. Either way, it is not possible to submit an “empty” search and get all results.
It is possible to set up a specific requirements for the input fields as to the minimum number of characters, but the plugin doesn’t give you a way to do this in the settings, you need to use a little custom code to add the HTML5 “pattern” attribute to the input fields. Alternatively, there is a minimum term length parameter that can be used to prevent words shorter than the limit from being used, but the HTML5 validation provides a better UI because it lets the user know immediately if the search term is too short. You can also use this to prevent wildcards in the input field.
There isn’t a way to specifically prevent wildcards in the plugin without enabling the “whole word” mode. Note that it is not possible to submit a search term that consists only of wildcards.
Another possibility for setting up a hard limit to results is to disable pagination (either through CSS or with a custom template), then set the “list limit” parameter to the maximum number of results you want seen. This may not be good UI if there is a legitimate reason for someone needing to scan through a long list of results.
So, you’ve got several options for controlling the use of the search inputs, it’s just a matter of deciding how you want the UI to work for people.
Hello Roland
Thank you so much. I read “that it is not possible to submit a search term that consists only of wildcards.” You are correct, it wont allow me to use a wildcard in both the first name and last name search boxes.
However, it does allow you to solely use a wildcard in either search box when the other search field has a search string. I dont want it to allow it in that circumstance.
Kind Regards
Jonathan
It’s probably a good idea to prevent a wildcard-only value from validating if all fields are required. I will make this minor change and release an update, that should help in your case.
Hello Roland
That is fantastic. What a great component you have developed. Wonderful!
Many thanks.
Jonathan
Hi Roland,
Where can I change Search and Clear buttons text into Dutch?
Kind regards,
Simone
This is normally done in a translation file. There is no Dutch translation, so you’ll need to set it up, there is a translation template in the plugin to get you started.
If you’re not familiar with how this is done check this article…
Hi Roland, I had the same question. I don’t remember translating the basis Search and Clear, they are somehow displayed in Dutch (nice). Unfortunately Multisearch does not translate these two buttons. Strange. Would be nice if there were some extra fields where you can define your own button texts.
(I really like the Participants Database, by the way, thanks!)
The Combo Multisearch plugin has its own translation files, so you will need to prepare translation files for that plugin in your language.
Hello Rolland. A quick question before I buy your plugin.
Say I want to register an indepenent worker in my participants database. In its form, the worker would fill their personal info and then their relevant professional info.
The users would use your multisearch plugin to search for whatever professional specification they need, and it’d return the most fitting entries that were registered in the database. But, I want the worker’s personal info to NOT be shown, just their professional info.
In short, I’d want to customize which fields are shown or not. Is that possible?
Yes, no problem, you have complete control over what fields are shown. In the shortcode (single or list) you can use the “fields” or “groups” attribute to control which fields are shown. For example:
[pdb_list template=multisearch fields="first_name,last_name"]
I just purchased the Combo Search and am a bit stuck on the template used to display search & results.
I’m using the shortcode [pdb_list template=multisearch-responsive suppress=true] and the results are functional, but a mess. I read on the Combo Multi-Search Page that “This plugin requires a special template. There are templates for both the list and search shortcodes. To customize the template, use one of the default templates provided by this plugin as a starting point.” But I was expecting something somewhat usable to start with.
It appears that the CSS is making the search widget much bigger than it needs to be by way of a box-sizing: border-box; setting. which includes padding. Is this somthing that is set with your plugin? This worked fine with the plugin prior to adding the multi-search/combo. Maybe I have something wrong?
Thanks,
Mike
Hi Mike,
I understand your frustration as someone who has build dozens of WP sites, but from my end of things there is little I can do anticipate and avoid issues like this, I hope you can understand. The plugin provides only the most necessary formatting, letting the real formatting work be done by your WP theme. Some themes just don’t do a good job with formatting forms. Ultimately, you’ll need to figure out what CSS rules you need to make it look the way you want. In most cases, a custom template is not needed, just some CSS rules.
If you need general help with working with CSS, I have this article which provides specific tool for working with CSS in WordPress:
Simple CSS Techniques for WordPress
Roland,
I’m fine with CSS. I was just wondering if I was missing something or if there was another template to try; just to get the thing a bit closer before I start with the CSS.
Thanks,
Mike
The responsive template is harder to format because all the elements can move around, so the CSS can be more complicated. Usually, it’s just a matter of limiting the width of the inputs and providing proper margins for the elements. Using the browser dev tool in responsive mode can help show what will happen to the elements with different screen widths.
Roland,
I found the problem. I ‘m using Beaver Builder and the shortcode doesn’t like being wrapped by Beaver Builder. I created a new page using the WP Text Tab, and it worked fine.
Mike
Hi Roland,
First, thanks for your awesome plugin and for being so ready to answer support questions. I’ve learned a ton through your documentation.
I’ve got a question about creating a custom search form. Do you have the equivalent of “PDB_Template” class for fields? Basically, I would like to create a search form and an entry form where I can control exactly how and where each field appears, and I think having the equivalent of the “PDB_Template” class that allows me to easily access the properties of each field might be the best way. If you have other suggestions as well, I’d be interested in those too.
Thanks!
A useful method to use here is:
where $name is the name of the field. That will give you an object where you can access the properties of the field and also several useful methods for displaying the field.
Thanks! I’ll try it out.
After trying out this suggestion, I’m unsure how to access the field properties.
For example, I tried:
<tr class="print_element_class() ?>”>
The page writes: ‘<tr class=' and then fails. Do I need to access the field properties in a different way?
It looks like you need to familiarize yourself with the use of php class instances. When you instantiate a class on a variable (which is what the code I showed you does), you need to use that variable to access the class methods. Also, the method you’re calling is in the PDb_Field_Item class, which is different from the class I suggested you use.
I suggest you set up your php error log so you can get more detail on what problems you’re running in to, it’s very helpful.
Sorry, the snipped didn’t come through:
<tr class="print_element_class() ?>”>
Sorry, I did initiate an instance of the class as you suggested…but the comment section seems to keep gobbling up my PHP. Let me try one more time:
“
That being said, what are the methods associate with the PDb_Form_Field_Def (I can’t find the documentation on it)?
Okay, one more time…this time I won’t type the PHP brackets..
“
Well, I seem unable to show my code in the comments…but if you have documentation on the methods available in PDb_Form_Field_Def, that would be great.
I’m sorry, I don’t have separate documentation, but the plugin code is well documented.