Product Support

Combo Multi-Search

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.

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.

shows how to interact with the multisearch fields interface
Configuring the Multi Search Fields

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.

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.

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.

Support Discussions for Combo Multisearch

  • I, and my users, are enjoying the Multisearch plugin !

    I would like to have full multisearch on one page (where I have tabs), while on a 2nd different page have only a dropdown available.

    Is this possible?

    • Is it possible to have 2 separate search types on 2 different pages?

    • Yes, you can do this with a custom template.

      If you look at the default Combo Multisearch template, (found at plugins/pdb-combo-multisearch/pdb-list-multisearch.php) you will see that the template checks for the combo search and the multisearch separately. You would create two custom templates, each one would only show either the combo search or the multi-search.

      Using Participants Database Custom Templates

  • I’m not entirely sure what i’m doing wrong…. I’ve tried all kinds of settings and went through your documentation. I’m using the default Participants Database theme. My website is at: https://tamuphysastr.wpengine.com/directory/

    Combination Search Fields: first_name,last_name,email
    Multi Search Fields: titles,bldg1

    The list comes up fine but any usage of the search displays nothing. Please help.

    • If you’re on WP Engine, you need to ask them to help you get php sessions working with Participants Database.

      • I got with WPEngine Support and they’ve added the Varnish cache exclusion cookie for PHPSESSID. I’m still not getting any results using this search.

        In the database, I see an entry in the wp_options table as “external_updates-pdb-custom-templates2” but i’m not using any custom template. I’m using the default. Could this have something to do with it? Thanks.

        • The sessions still are not working. You could ask them to look into i further, or you can try using the “Use Alternate Session Method” setting.

  • Hi

    Have set up on this page https://www.gowerbonecaves.org.uk/gazetteer/ along with a general search box and works ‘as it says on the box’ with the different field combinations. The simple search box gives results I was not expecting but perhaps that is me misunderstanding how it is meant to work. Entering search words that might be found in the Site Name or Parish fields produces the shortlist I would expect to see. Trying items that appear in either the Archaeology or Fauna fields produces nothing.

    Can you please advise what I might be doing incorrectly.

    Many thanks

    • The simple answer is you may need to change the search modifier settings to get the expected results.

      Understanding search results in detail requires you are familiar with the exact contents of the database. You can see this if you open phpMyAdmin (typically found in your hosting control panel) to look at the stored data in it’s raw form. Next, you need to turn plugin debugging on (under the advanced tab in the plugin settings) and then observe the database query that is used when a specific search is made. You can do a detailed diagnosis of the results with that information.

      • Many thanks for the guidance

        • Hi Roland
          Would you please be able to look at this page https://www.gowerbonecaves.org.uk/gazetteer/ in Safari (iPad). Searches result in no records shortlisted (even when I know they should). Furthermore, when I try to Clear, the original list of records does not return Fine in Edge and Safari.

        • This is the same problem you had a while back: php sessions are not working on your server. I thought you had that one solved, is this a new issue? It’s not related to the browser, but it is related to the use of cookies. What did you do before to solve your search result issues?

        • Sorry about that; some things had changed. Is working now.

          I have tried to progress my Combination Search but am not getting very far. My perceived problem relates to using a search word taken from either a Dropdown List field or a Multiselect Dropdown field. If the item in the dropdown list is just one word, I get the correct answer. eg selecting the search word ‘bone’ correctly shortlists 3 records; one where ‘bone’ is in the Site Name field and 2 where this is in the Archaeology field. However, selecting the search word ‘art’ or ‘cave art’, which only appears for one record in the Archaeology field produces nothing. If I include the quotes around the search word, ‘cave art’, then I get the correct answer. Is this what you would expect?

          My settings are:
          Enable Filter Mode ON
          Combination Search Fields AS PER THE TABLE
          Show the Combo Search Modifiers ON with deafult set to ANY
          Use Autocomplete for Combo Search ON
          First-Letter Autocomplete ON
          Autocomplete Auto-Search ON

          Thanks for your patience

        • It sounds like you have “Whole Word Match Only” enabled. That would prevent a word that is part of a phrase from matching, so yes, the result you are getting would in that case be the expected result.

        • I wish it were that simple but unfortunately, “Whole Word Match Only” is not checked : o(

        • OK, so I provided instructions for analyzing the search results, what do you see as the database query when you are getting the undesired result?

        • I get this when I enter ‘art’ as the search term:
          PDb_List::_setup_iteration list query: SELECT p.id, p.site_name, p.parish, p.human_activity, p.fauna FROM wp_participants_database p WHERE (p.site_name LIKE “%art%” OR p.parish LIKE “%art%” OR p.human_activity LIKE “%\”art\”%” OR p.fauna LIKE “%\”art\”%”) ORDER BY p.site_name ASC

          and this when it autoselects ‘Cave Art’
          PDb_List::_setup_iteration list query: SELECT p.id, p.site_name, p.parish, p.human_activity, p.fauna FROM wp_participants_database p WHERE (p.site_name LIKE “%Cave%” OR p.parish LIKE “%Cave%” OR p.human_activity LIKE “%\”Cave\”%” OR p.fauna LIKE “%\”Cave\”%”) AND (p.site_name LIKE “%Art%” OR p.parish LIKE “%Art%” OR p.human_activity LIKE “%\”Art\”%” OR p.fauna LIKE “%\”Art\”%”) ORDER BY p.site_name ASC

          Both these searches show nothing

        • OK, yes, when searching for a value that is in a multi-select field, you cannot search for a word within the value. This is because it needs to pick the value out of the stored value, which includes characters that need to be ignored. If you look at the database value for that field, you will see what I mean.

          I can revisit this later to see if I can improve upon that, but for now multiselect fields will work like that.

        • Many thanks for explaining as I did not appreciate that. I will put some instructions with the search

  • I have Participants Database (1.9.3.4) and Combo Multi Search (1.5.2).
    Running on a dev site:

    Autocomplete just stopped working after I deleted a record from the database.

    Any idea what to look for?

    I emailed you some more information a few days ago.

    Thanks!

    • What do you mean it stopped working? Are you seeing any errors in your browser console when you try to use the autosuggest?

      • No errors, just not working – when I type it does not autocomplete – the search itself is working (when I hit Enter,) but it’s just the autocomplete that stopped working after deleting a record.

        • OK, I never got an email from you (at least not that I recognize as being from you) so I have very little to go on here. The two things are not directly related, so I’m not sure if there is a connection or if it is coincidental. Can you post a link to the page so I can see what’s happening?

  • Hi,

    I just can’t figure how to show the search console on the webpage…
    Should I just copy the file pdb-list-multisearch.php to wp-content/plugins/participants-database/templates ? and add the shortcode [pdb_list template=multisearch] to the page I want? It’s just displaying the regular [pdb_list] without the search console. Sorry for my confusion :/

    Also the plugin Custom Template Folder 2.0 but I got a bit confused…

    This is the link I’m doing tests
    https://www.brandingpool.com/notablemx/buscar2/

    I’m using Participants Database 1.9.3.4 and Participants Database Combination Multi Search 1.5.2

    Thanks,
    Mario

    • I copied the file pdb-list-multisearch.php from wp-content/plugins/pdb-combo-multisearch/templates

    • You don’t need to copy or move any templates, just use [pdb_list template=multisearch] for your list shortcode.

      • I tried using but it is displaying the listing results and not the search console

        Where do I do this? where do I enable the plugin template?
        To use this plugin, you must enable the plugin template in your list shortcode like this: [pdb_list template=multisearch]

        I already tried the same procedure on another wordpress installation and got the same result not showing the search console

        • the search control * sorry

        • to show the search control and display the listing should I use the shortcodes below in this order? on a page?
          [pdb_search template=multisearch ]
          [pdb_list template=multisearch ]

          on the DOM I’m only getting the div but without content

          — (no more divs just blank) —-

        • Don’t use the [pdb_search] shortcode, that is for special cases.

          Using the Search Shortcode

        • Make sure you have the Combo Multisearch configured. You need to tell it which fields to include in the search control.

  • After updating the combo multi search plugin, (1.5.2) fields with multiple choices now displaying garbage on my screen.

    Help !!

    • Can you provide a link so I can see what’s happening? Also, show me the setting you are using for the “options” of the field.

  • I have just updated Participants Database and the Combo MultiSearch and am now getting a couple of extra radio buttons labelled ‘Any’ and null_select below them.

    The search still seem to work OK.

    Any thoughts? This will only be visible to logged in users so if you contact me direct I can give you a login.

    • An update to my own post.

      I can see in the back end the ‘Any’ option was checked. I don’t remember seeing that option before, but it’s a good idea. However it seems to generate the ‘null_select’ message for some reason. I have disabled it button for now because my users have not seen it before and it’s not in my site documentation.

      • Make sure you are using the latest version of Combo Multisearch, should be 1.5.2

        Looking at the field definition for the field you’re talking about (this is on the Manage Database Fields page) do you have a “null_select” option defined in the field options?

  • I am getting a fatal error ……
    Fatal error: Uncaught Error: Call to undefined method PDb_FormElement::null_select_key() in /home/tucsonqu/public_html/wp-content/plugins/pdb-combo-multisearch/pdbcms/Search/Control_Element.php:242 Stack trace: #0 /home/tucsonqu/public_html/wp-content/plugins/pdb-combo-multisearch/pdbcms/Search/Submission.php(929): pdbcms\Search\Control_Element->get_search_control() #1 /home/tucsonqu/public_html/wp-content/plugins/pdb-combo-multisearch/pdbcms/Plugin.php(258): pdbcms\Search\Submission->search_controls() #2 /home/tucsonqu/public_html/wp-content/plugins/pdb-combo-multisearch/templates/pdb-list-multisearch.php(46): pdbcms\Plugin->__get(‘search_controls’) #3 /home/tucsonqu/public_html/wp-content/plugins/participants-database/classes/PDb_List.class.php(260): include(‘/home/tucsonqu/…’) #4 /home/tucsonqu/public_html/wp-content/plugins/participants-database/classes/PDb_Shortcode.class.php(343): PDb_List->_include_template() #5 /home/tucsonqu/public_html/wp-content/plugins/participants-database/classes/PDb_List.class.php(213): P in /home/tucsonqu/public_html/wp-content/plugins/pdb-combo-multisearch/pdbcms/Search/Control_Element.php on line 242

    • You need to update to the latest version of Combo Multisearch, should be 1.5.2 and you should see it on your plugins page.

  • Hi,

    Apologies, one other question/issue. I’m using optgroups for two multi-select checkbox fields. The opt-groups show up fine in the admin panel when I’m adding a participant. However, on the search form, only the first opt groups shows up and then all the options (for all the optgroups) are listed under the first optgroup. None of the other optgroups display.

    Thanks!

    • You’re right, it looks like this is not working as expected. I am going to need to release an update in order to fix this, so thank you for pointing out the problem.

  • Hi,

    I’m using multi-search, and would like to be able to determine for each individual field whether it’s “AND” or “OR.” For example, if someone is searching for a restaurant, I’d like for them to be able to select multiple cuisines types and then select their neighborhood, and it would show them all of the listings that are ANY or those cuisines types in their neighborhood. Rather than only showing restaurants that serve *all* of the cuisine types selected and are in their neighborhood.

    Not sure if that makes sense? Is this possible? Or an add-on that exists?

    Thanks,
    Megan

    • Yes, this makes sense. Unfortunately, it is not possible at this time. I do have this on the list of improvements to make, but I don’t know when it will be available.

      • Okay, thank you for letting me know! I’m definitely super interested in this (and would be willing to buy it if it ended up as a paid add-on rather than an update), so will keep an eye out for any news! :)

        • I’ve got an update to the plugin coming out today or tomorrow.

      • Hello, I am also interested in this. Has this feature been added?

        • Yes, it’s in the plugin. You’ll find the setting in the Combo Multisearch settings.

Leave a Reply to Ryan Carmichael Cancel reply

Your email address will not be published. Required fields are marked *

Would you like to be notified of followup comments via e-mail? You can also subscribe without commenting.