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 sets of selectors/checkboxes/text fields that set 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

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.

Multi-search provides a comprehensive interface for searching on multiple fields. Each field included in the search is provided with a search control appropriate to the type of field. The search control generates five different types of search control: text input, checkboxes, radio buttons, dropdowns and multi-select dropdowns.

To configure the multi-search, put the list of field names you want included in the search in the “Multi Search Fields” settings as a comma-separated list.

For dropdown, checkbox and radio button controls, the selections shown can either be drawn from the field definition, or from the database entries. If “Use DB Values in Dropdowns” is checked, a list of unique values is gotten from the database entries and used as the selections presented, so every selection will find a match in the database.

It’s also possible to generate a dropdown selector for text fields, by enabling “Text Fields as Dropdown Selectors.” This provides the user with a set of words to choose from that are taken from database entries. For instance, if one of the fields in the multisearch is “First Name,” the search control would be a dropdown of all the unique first names in the database.

Filter Search Mode

The Combo Multisearch has two general modes of operation. With “filter mode” on, all chosen search values must be present in the record 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 is present in the record.

Each search type, combo or multi, has a “Whole Word Match Only” switch so that searches made will only match a complete word in the search, not portions of a word.

Returning to the Search Results

Under the General settings tab, is a checkbox 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 Search Control

The Combo Multisearch Add-On provides it’s 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 ]

This uses the plugin’s built-in template, but you can also add Combo Multisearch to any list or search shortcode template by using the template functions provided by the plugin.

It is also possible to define the list of fields to search in the shortcode, for instance:

[pdb_list template=multisearch search_fields='company,city,state']

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]

Support Discussions for Combo Multisearch

  • Hi Roland,

    Thank you very much for your last update! It fixes all issues.

    I’m sorry for writing you so often)) I have one more problem, and I cannot find what causes it. When I perform search on Currency fields, the search values disappear from the input fields on form submit.

    I use “Ocean WP” child theme and display the shortcode through theme’s page template like so:
    echo do_shortcode(“[pdb_list template=fitters filter='role=user&approved=yes']“);
    While debugging, I removed everything else from this template (no footer, no header, no styles, no JS). On search form submit Currency fields become empty; the selected options for other field types are still there.

    If I place shortcode [pdb_list template=custom filter='role=user&approved=yes'] directly to the page content through admin’s panel, everything works as expected.

    Not sure if it relates to your plugin in any way, but I hoped you could give me a hint where to look to resolve this issue.

    Thank you!
    Alex

    • There is a typo in my previous post. Of course I use the same template name in the shortcode [pdb_list template=custom filter='role=user&approved=yes'].

      Also tried to use default one [pdb_list template=multisearch filter='role=user&approved=yes'] .

      It seems that when a shortcode is placed to the page content in admin’s panel and search is performed, only filtered list of participants is refreshed. But, when it’s used in child theme’s template with do_shortcode() function, the whole page reloads.

      • The plugin only loads it javascript on pages that have a plugin shortcode, so if you use do_shortcode to place plugin content it doesn’t know the shortcode is there, and so the javascript is not loaded.

        You can add a filter to your code so that it lets the plugin know the shortcode is present. For example:

        add_filter( 'pdb-shortcode_in_content', function ($in_content) {
        return true;
        });

        You can put that where you have the do_shortcode in most cases, but be aware that if this happens too late in the page load, it won’t work.

        • Hello Roland,

          Thank you for the example. I tried to put your code at the top of the page template, right before the header is printed. Actually, also tried to move this code around the page without luck. Probably, just like you said it’s to late for this filter to apply.

          Do you think there is another workaround? I can think only of to store these values somewhere using JS on form post, and then put them back to input fields when page is loaded.

          Thanks!

        • That filter is the correct way to tell the plugin to load the javascript, but if it gets executed too late, to doesn’t work. I wrote up an article on how to deal with this so that other users can benefit if they need it.

          Placing Dynamic Shortcodes using do_shortcode()

  • Hi Roland,

    After your recent update I’m experiencing following behavior using the search form.

    First, I deselected “-Any-” option and selected one option under my Multiselect Checkbox field. The search term has been applied and the list showed the correct results, but the feedback message is displayed using the format string “Found %d records” from the first block under IF-statement “if ( empty( $search_term ) && $PDb_Combo_Multi_Search->is_search_result() )”. It supposed to tell number of found records AND the search term that has been applied, in this case the option from Multiselect Checkbox. (It worked correctly before this update)

    Second, I have a Currency field on my search form that is represented by two input field as a range. On first page load, or when “Clear” is clicked, the ‘from’ field has ‘0’ (zero) as a default input, the second input field ‘to’ is empty. When search is performed, the feedback message has ‘€0 – €’ as a search term string for this field. If I manually clear ‘from’ input field, the message has ‘€ – €’. I would expect nothing in the feedback message for both cases. Also, it would be nice to begin search when all fields are empty, no default values as ‘0’ for Currency field.

    Thanks!
    Alex

    • Thanks, Alex, I’ll take a look.

    • So far I have been unable to duplicate the problem you’re seeing in the search results feedback. Does this problem come up only when a specific value is selected in the checkboxes? Trying to see how this could happen.

      For your second issue, it’s not supposed to do that, I will release another update to fix that, thanks.

      • No, it doesn’t matter which option is selected. Actually, you may select more than one option under this field, the result is the same – no search terms appear in the feedback message. But, if you make a selection in any other field on the form as well, the feedback message contains the search terms for all fields.
        This behavior is related only to a Multiselect Checkbox field. I tried to change the type of this field from Multiselect Checkbox to Multiselect Dropdown, and the problem disappeared.

        Some additional information:
        – “Combo Multi Search” following settings
        * Add an “Any” Option – ON
        * Text For the “Any” Option – “-Any-”

        – Search form contains following fields: Mutiselect Checkbox, Dropdown field, Multiselect Dropdown and Currency.

        – The shortcode also has filter attribute.
        [pdb_list template=custom filter='role=user&approved=yes']

  • Hi Roland,

    I think there is a bug in your plugin.
    I have in “Combo Multi Search” following settings
    * Add an “Any” Option – ON
    * Text For the “Any” Option – “-Any-”
    On the filter form I have a Dropdown field, a Multi-select Dropdown and a Mutiselect Checkbox. All of them have an “-Any-” option according to the settings mentioned above. If you set a search value in any of these fields and perform search on that criteria, you will see some result and a search result feedback message. This message contains search terms from the current search. Now, if you select “-Any-” option in the field you just searched on, the list of participants contains new search results matching “-Any-” option, but the search result feedback message still have the search terms from previous search. This message gets updated only if other than “-Any-” option is selected.

    I have a recent version installed 1.5.9

    Best regards,
    Alex!

  • Hello. I’m quite impressed with the documentation you have provided for the Participant’s Database plugin and its add-ons.

    I’m working on a specific use case where customers can come to a page, enter an old order number and zip code which pulls up the rest of their information to edit. We’re essentially using the order number and zip code as validation before they can view or change their info.

    Is it possible to switch off auto-complete on the Combo Multisearch add-on? We want it to exactly match both fields, but don’t want to give users a hint as to the matching info.

    Or, is there possibly a better way to accomplish the same objective. I’ve just started using this plugin today.

    Thanks so much.

  • Roland,
    I’m still having an issue using Combo Muti-Search with a Chosen DropDown option if it has been checked as “read-only”

    View my issue here: https://stagephysastr.wpengine.com/dir-search/

    The “Job Title(s)” field…

  • Hello, when I put the multisearch shortcode onto a page, it looks like this (linked to screenshot I took)
    https://www.countyunclaimed.com/wp-content/record-search-page.PNG

    The search function works great, but the search fields are so far apart and way down on the page.
    Thank you for your assistance

  • I am trying to add this to a specific page, where I want them to be able to search for their item number or model of product, and have the results return on that same page.

    When I add the code to my page (built with Elementor), it’s going between not working at all, or telling me there are 2 results and not showing anything… and it’s HUGE – takes up SO much more space than it needs to.

    Is this add-on not compatible with Elementor?

    • I don’t know specifically if there are any incompatibilities with Elementor, I have not tested it. Can you provide a link so I can see what it’s doing?

  • Hi Roland,

    i have a small issue using multisearch. I have a multiselect checkbox. There are several options + checkbox “-Any-“. However from my point of view option “-Any-” is equivalent to situation when all checkboxes are not selected. Can I remove somehow “-Any-” from the search list?

    Thanks.

    • Take a look at the Combo Multisearch settings under the Multi Search tab: Add an “Any” Option

      you can turn it off there

      • Thanks a lot for your answer.

        I’ve checked this option. It works, but not in my case. I have several fields – multiselect checkbox, multiselect dropdowns etc. I need option “-Any-” in multiselect dropdowns. But I don’t need “-Any-” in multiselect checkbox. Can I specify somehow where this option have to work?

        • To do something specific to a single field like that, you’ll need some custom code. Probably easiest to add a bit of javascript that takes out the “any” option for that one field. You can use a Custom Template for that.

  • Hello,
    I’m sorry for possible duplicate, but I couldn’t find this topic.
    I have in “Combo Multi Search” settings
    * Add an “Any” Option – ON
    * Text For the “Any” Option – “-Any-”
    The DB has a couple of Dropdown fields and a couple of Multi-select Dropdowns. So, in the search area I have “-Any-” options for dropdown fields, but multi-select dropdowns contain blank line as a first choice and then values from the records in the DB. I was expecting to see “-Any-” value instead of blank line for multi-selects as well .
    Any thoughts how to fix it?
    I have the recent update installed 1.5.6.

    Best regards,
    Alex!

    • I forgot to mention the settings for multi-select fields in DB.
      The fields are required, they have a default value set and the first value in the options list is “null_select::false”.

      Thanks!

    • I see in my tests that the multi-dropdown field does not get the “any” option configuration from the Combo Multisearch plugin. Not sure exactly what the problem is yet, but I will probably need to issue an update to fix the bug.

  • Hi Roland. Great product. I am using the Combo Multi-Search plugin. For some odd reason, my dropdowns have stopped working. I have comma separated lists in the options group for the dropdown lists and multi-select dropdowns. But, the lists in the options are no longer showing up on the page. I have successfully used your product for over a year. Recent changes include moving the site from a Windows Server to an Ubuntu server.

    • Roland,

      I should note that I have tried everything I can think of, including deleting the field and re-adding it. Nothing seems to work. However, if I set it to draw values from the database, it works fine. But, I don’t want the values coming from the database, I want them to come from the Options group.

      Thanks.

    • Hi Kurt,

      Thanks for letting me know about this problem. There was a bug related to using the “alpha sort” option. I just issued an update to Combo Multisearch that should fix your issue.

Got a Support Question?

You have to agree to the comment policy.

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