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

  • If I have a multi-word field I am using the combo search and autocomplete on, I can’t get it to display unless I start with the first letter. But I have unchecked the first letter box.

    For example an address someone might just type Vancouver and the field might not start there.

    Is there a way to make the matches match other than just starting at first letter?

    • I figured it out — caching situation. It works.

      Can I limit the number of results though? Or force a few letters prior to autocomplete kicking in? If someone types ‘e’ the dropdown goes off the page and screws up the layout.

      • The autocomplete selector is not supposed to mess anything up even if the list is huge because it’s positioned absolutely (that is, it’s a layer over the page) and doesn’t need to push anything out of the way to appear. There may be something in your CSS that’s changing how the autocomplete selector is positioned. It’s also possible to limit the size of the autocomplete selector with some CSS. For example:

        ul.ui-autocomplete {
           max-height: 10em;
        }

        To minimize the size of the autocomplete selector, it’s best to use “first letter autocomplete” as it will return fewer suggestions.

        As the user types in more letters, the size of the list gets shorter, so typically the appearance of the too-large list is brief.

        Finally, if you really want to modify how it works, you can use the “minLength” parameter in the autocomplete configuration to set the minimum number of letters the user must type before the search is run. This is set to “1” by default, but you can set it to a higher number. The plugin doesn’t provide a way for you to do this, you would need to modify the combo-multisearch.js script to make a change like that.

        • Fantastic. Thank you.

          I was thinking if I could do a MySQL LIMIT on the autocomplete, but minLength will work.

          And by ‘mess up’ I just mean the scrollbars change length and the automcomplete runs off bottom of page. Not really messed up just noticeable.

          Last, thank you for your help, thank you for helping so quickly. The software is great and the support even better.

        • One more question, I searched for minLength in the folder and couldn’t locate it, if you have the location handy? Thanks!

        • It’s not there, the plugin uses the default, you would need to add it. This is the documentation here: jQuery UI Autocomplete API

        • I just released an update (2.3.7) to Combo Multisearch that adds a setting for the minimum search length for the combo search autocomplete.

        • Unbelievably helpful. Thank you so much.

  • I’m interested in Combo Multisearch add-on. But before to purchase it I want to be sure that it fits my case of implementation of database. Can you please answer in my following questions:
    1. Is the Add-on compatible with WordPress version 5.7?
    2. I have fields with type Multiselect/Other in my database. The fields options are translated in some languages i.e the options of one of the fields are: [:en]Website[:bg]Уебсайт[:nl]Website::website.
    So my question is: Is it possible your add-on to search in such fields for the different languages. I.e if the search is displayed in other language different than English should the search be correct?

    • Yes,this will work. The plugin is fully compatible with the latest WordPress. The search looks in the multilingual titles for a match, so the search can be performed in any language.

      Give it a try, of it doesn’t work the way you need, I’ll give you a refund.

      • Thanks Roland!
        Another question:
        I’m using Multiselect/Other field in my Database. Everything with the insertion is OK but I want to search for this field for “Other ” values. How this can be done?

        • Well, how you might do this depends on the context. It’s possible, but a bit complicated, to use a database query for this. What is it you need to do?

        • Ok. I have a field lets call it “Country of birth”, then I have list with lets say 5 countries. The field is “Multiselect/Other” so gives an opportunity to user to input Other country different than those in the list.
          Where the search and the list of the records are displayed I need in the search options to have ability to search for those records that user pointed out Other “Country of birth”.
          As I understand you I need to add the “Other” option in the list and then to change the database query, is that you mean?
          If so can you please give me more specific instructions where (in which files) I should do changes?

          Thanks in advance!

        • You may be able to do something like this on the frontend, there is a filter you can use to alter the search query that is used when a search is made. This is explained in the List Searching section of the Plugin API.

          You will need to figure out how to present this option to the user, for that, you can use a custom template for the list display.

          It won’t be possible to do this for the admin list, it is not as customizeable.

          An approach that could be easier to implement is to use two fields for your country. The dropdown should be a regular dropdown (not a dropdown/other field) that includes an “other” selection. You then have another country field that is a text input. If their country is not in the dropdown, they select “other”, then type the name of the country in the second country field. Then you can easily find all the records that used the extra country field by looking for “other” in the country dropdown field.

          You can use some javascript in your form to enhance this so the second field isn’t shown unless they choose “other” in the first country dropdown.

  • When I goto the multisearch section and attempt to add a field, my fields do not appear in the list, only:

    Approved
    Record ID
    Private ID
    Date Recorded
    Date Updated
    Last Accessed

    I’ve hunting around but I’m missing something…

    • That’s curious, pretty much all fields should show up in that list. What kind of fields did you create?

      • Majority are text-line, 2 dropdown. 25 fields.

        • Are any of them configured in the Combo search field list? A field can’t be in both.

        • This was indeed the issue. I was unable to remove/save the fields from the Combination Search Fields box. I had to use PHPmyadmin to remove it from wp_options , pdbcms_settings

        • What I’m trying to accomplish is:
          1. A text search box for all fields/the entire database
          2. A filter with 2 fields that are dropdowns to limit the search or filter after.

          All fields are text-line except the 2 I want to use.

        • You can do this, you just can’t have a field in both the combo search and the multisearch. You can set your 2 dropdown fields as multisearch fields and have them appear as dropdowns as long as they are not included in the combo search.

          You will need to use “filter mode” (under the general settings tab) so the dropdowns will act as filters for the results.

        • This worked, thank you.

  • I’m probably missing something obvious when setting up a multisearch custom template. it’s not finding the custom template and using the default instead.

    I’ve modified the pdb-list-multisearch.php and renamed it to pdb-list-multisearch-awc.php, then modified the shortcode to ‘[pdb_list template=multisearch-awc search=true]‘. It’s not finding the custom template. Doesn’t matter if I place the modified template in my themes/child-theme/templates directory, or in plugins/pdb-custom-templates2/templates in your custom templates plugin (I’ve currently got it in both places for testing). With debugging on it still shows ‘‘.

    Seems like the only way I can get it to find the custom template is to put it in the plugins/pdb-combo-multisearch/templates directory (which obviously isn’t a good idea). Is there something special about the combo-multisearch plugin that prevents it from looking for templates in other locations?

    • The correct location for the templates if you are using the custom template add-on is wp-content/participants-database-templates/ it looks like everything else you’re doing is correct.

      • Ugh… RTFM! Thanks Roland… I just misunderstood the blatantly clear documentation.

  • Hello
    This add-on looks great but (to make sure :-) ) does it work with “Adding an Edit Record Link to the Frontend List”?
    thanks

    • Yes, but you need to know php and HTML to make a custom template using the multisearch template, then adding the edit link to it.

      • surprising…the basic search does work fine with the “Adding an Edit Record Link to the Frontend List” custome template.
        isn’it the same output for both searches : a list of records with the ‘edit-link’ field allowing to retrieve the full record?

        In the case there really is a need for a custom template, do you provide guidance to build it? is it complex or simple? Can you do it for a fee?

        • Yes, you will need a custom template…I’m sorry, I don’t do custom coding, but this is not difficult.

    • ok then can you provide some guidance on how to make this cutom template?

      • It’s simple, just use the pdb-list-multisearch.php template as your starting point to adding the edit link. The part of the template you need to modify is the same in both cases.

        • Thanks much for this valuable info.

          I understand that I need to modify pdb-list-multisearch the same way
          pdb-list-edit-link was modified from pdb-list-default…?

          have a nice new year’s eve…11 hours behind us in Europe!?

        • Yes, that’s correct.

  • Hello

    I love this plugin for my database.

    However, I have just installed the TinyMCE plugin and changed my “search” page font to Arial, sized 12. The text on most of the page is now 12, but the combo boxes and any results continue to appear in a larger font size. How can I ensure the plugin uses Arial, at size 12, as well?

    In addition, is it possible to define the length of any search fields?

    Kind Regards

    Jonathan

    • Hi Jonathan,

      The plugin doesn’t control which fonts are used, so it will be up to you to make any modifications to the CSS that are needed to get the appearance you want.

  • Hi
    I’m Using a combo search on my Site. It seems to work in generally but i noticed the autocomplete does not function. Also when i press the “clear” button after a search basically nothing happens.

    I use the following shortcode and i think i configured the autocomplete to be active:
    [pdb_list template=multisearch-responsive ]

    On the console the page with ther shortcode drops a jQuery error “Uncaught ReferenceError: jQuery is not defined”. Might that be related?

    Kind Regards
    Christoph

    • Yes, that console error indicates a problem that will basically prevent any javascipt from working properly. Are you using some kind of accelerator plugin that aggregates the javascript? These can prevent javascript from working properly if not correctly configured.

      Whatever the cause, jQuery is normally loaded by WordPress, so something fairly fundamental is going wrong with the page load.

      • Hmm i checked Theme options and removed an option that loads jQuery in the Footer. That resolves the js-error but the functionality of autocomplete and the “clear”-button is still not given.

        Any other thoughts on this?

        • You’re probably sill having javascript issues. Open the developer tools console and see what is coming in there when you try to clear the form or get the list of autosuggest terms. It may be that jQuery is still not loading early enough for the plugin code to find it when it needs to run. Loading jQuery in the footer does not always work.

        • Since i deactivated the “load js in footer” option i do not get anymore errors in the console or the network analysis tab when performing any action with the plugin. I don’t see any obvious problem, would you mind to have a look at it?

        • Did you try using a simple “buy now” button? It’s possible the button you’re using is not compatible with the plugin.

          You can send me a link to the page if you want me to check it, but try changing the button to see if that helps.

  • Good morning. beautiful plugin. I use this plugin on a site in French. How is it possible to change the search result text that appears in French (“Found x results while searching for”).
    I tried to complete pdb-combo-multisearch-fr_FR.po but without success.

    Can someone help me?

    • This string in in the translation template, you can find it there and make sure it is in your French tanslation file. I notice these strings are not translated in pdb-combo-multisearch-fr_FR.po so you will need to translate them then rebuild the translation binary. You need to use an application like Poedit to do that.

      • Hello,
        Thank you very much for your prompt response.
        So I did the whole translation of the pdb-combo-multisearch-fr_FR.po file.
        I can communicate the file – if someone accepts contributors – as it will no doubt help a lot of French language users if this is incorporated in the next update.
        I can send it by email (which one?).
        Ludwig SERRE

  • Im trying to find a way to add tooltips to my combo multi search. Ideally id like to hover over the fields in the multi search settings to see a description of the field. I thought the help text may do this but it sits below the text. Is there a way to make this only visible on hover?

    • yes, you need to use a “title” attribute for that. This is added in the Multisarch Fields settings. For example:

      shows an attribute setting

      • Thanks for the quick replay. I’ve tried this numerous time in different browsers and Im afraid I just cant get any text to appear. The fields are all radio buttons or multi select as opposed to text fields. Would that make a difference?

        • ok, titles won’t work with those elements, I’m sorry. Using the help text is the best you can do in that situation.

  • Hi Roland,
    I deleted a field-definition in the database. I did not need field anymore. So far no problem. I forgot to delete that field in the multi-search definition. It is still there, without a name, just () in the upper left corner. I cannot delete that field in de multi-search defintions. When I try to delete it asks for a confirmation, as usual. I confirm the deletion and it still stays there.

    I deleted all three PDB-records in the wordpress-database. At the moment I am in the process of redefiniton of all records. This does not solve the problem. The template that I used for the multi-search worked fine till the moment I deleted that one field. It now gives the below error:

    “Warning: array_merge(): Expected parameter 1 to be an array, null given ……/wp-content/plugins/pdb-combo-multisearch/pdbcms/Search/Control_Element.php on line 458”

    Please advise how to proceed,
    Thanks,
    Michel

    • The quick fix is to add the field you deleted back in with the exact same name, then delete it from the Multisearch fields config. You can then go back and delete it from the main plugin.

      Thanks for bringing this to my attention, I did not realize this problem could come up.

      • Hi Roland,
        Thanks for your quick answer. The quickfix does not work unfortunately. I recreated the deleted field but the multisearch config does not recognise it in the old definition. I can make a new search defintion with the recreated field. Any other idea to proceed?

        Thanks,
        Michel

        • This means the name of the field you created does not match the original field’s name.

          If you have access to the database directly (using phpMyAdmin), you can see what the original name was. If you look at the main plugin table wp_participants_database, look for a column that belongs to the field you deleted. The name of that column is the exact name you should use to recreate the field.

          Another way to fix this is to reset the multisearch settings. In phpMyAdmin, go to the wp_options table. Look for an entry named “pdbcms_multifields” and delete it. You’ll need to start over with your multisearch fields configuration.

        • Thanks Roland, problem solved. Thanks to phpmyadmin. I did recreate the correct field. However, in an ealier attempt to solve the problem I deleted the whole pdb database and I deactivated the combosearch. I am still in development mode, not yet live.
          Thanks again,
          have a nice day.

Got a Support Question?

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.