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

  • Hello Ronald
    I have installed [pdb_list template=multiserch] and it works perfectly.

    But I have problems with [pdb_search template=multisearch]
    I want this box on a separate page so the user does not see the whole database, only what he is searching for.
    I have include the “target_page” into the short code. And on the target page I have placed [pdb_list]. The display on the target page is perfect.
    But the search does not pulling the data at all. Not even when I sellect all filters to “ANY” I have flushed the caches on my PC and the website host has done the same. I still can not pull the data. What the problem can be ?

    • OK, you can also prevent the list from showing anything until a search is preformed by using the “suppress” attribute, like this:

      [pdb_list template=multisearch suppress=true]

      For details on setting up the [pdb_search] shortcode check this page: The Search Shortcode

      Probably, you need to set the “target_instance” attribute in the search shortcode.

      • Thank you, that helped.
        But I still have one problem. I use the target search fields.
        While performing searches I have the drop down choices available. That is good.
        But these are not all the choices the database contains. I recall you have suggested to have the cache on the server to be flushed. That helps and after cache flush I see in my search all the choices from drop down list available. But this can not be a solution. Imagine few hundreds people may enter data per day. I can not keep contacting WP support asking them to flush the cache. Can this be done automatic. Is there any tool, add-in, plug in you can recommend that will be attending to the cache purge regularly and automatic ?

        • I’m not the one to ask about this, I wouldn’t know the specifics on how that cache can be flushed by a plugin. If it were possible for a plugin to do this, you’d have to add custom code that triggers the flush any time that particular field was updated.

  • Hi,
    Just purchased this add-on and have discovered a bug. When a drop-down list value has commas in it such as ‘Banking, Finance and Insurance’ the Multisearch Dropdown is splitting them into seperate categories which become ‘Banking’ and ‘Finance and Insurance’.
    Then obviously if you try and filter records by these split categories it will not match any results.

    I’ve added the field values in the Manage Database fields section using the HTML entity you advised me to use, such as Banking, Finance and Insurance.
    These fields are displaying correctly in the back-end when editing a record but the Multisearch filter is splitting them on the front-end.

    • It’s converting the html entity to a comma in the comment I just posted, but the one I used is listed on here: https://www.freeformatter.com/html-entities.html

    • Let me take a look at this…what kind of field is it defined as in Participants Database?

      • It’s a Dropdown List field. I entered all the options in the values field seperated by commas and then any options that had commas within them I used that html entity.
        As mentioned above, they display correctly when I go in and view a single record but the Multisearch dropdown field is splitting them.

        • Do you have “Use Db Values” enabled? If so, I’ve got a fix for this coming in the next update. If not, I’m unable to reproduce the problem here: values that include the comma HTML entity show up as a single option with a comma.

        • Ah, yes I had “Use Db Values” enabled. Unchecking this fixes it, thank you.

  • Hi Rolland,

    Combo Search Autocomplete function does not work for fields that contain numbers only, and it does not matter if the field is text-line or numeric/decimal type.

    Could you have a look?
    Roman

    • Yes, you’re right, it looks like the entries for a “numeric” type field don’t display in the autosuggest. Thanks for pointing this out, I’ll see about getting a fix for that in soon.

      • Hi Roland, have you fixed it? It remains the same after last update.

        • Yes, I fixed it in version 1.2

          Just tested it and it’s working as expected. If you’re running version 1.2 or later and it doesn’t work, maybe you can post a link so I can check it out.

  • Hi Roland,

    I have upgraded to the latest version and now “Any” Option is not shown for radio buttons.

    Any fix?

    • The same for Multiselect Check Box.

      As for Enable Filter Mode I think we should really have a posibility to disable the filter for any multiselect form element (checkboxes, dropdowns,…). It would improve a versatility of the multi search function a lot.

      Regards
      Roman

      • I have a major update in the works that will give more flexibility to the configuration of the search fields…no promises on when though, coding work hasn’t started yet.

    • It was taken out in the last update. If the radio buttons are left unselected, it has the effect of being an “any”

  • Hello! I’m a newbie so forgive me if this is answered somewhere! My question is – how is the data in the database secured/encrypted? I’d like to give users some big words :) so they feel confident.

    • There is no simple answer to questions about data security. It’s important to understand that the actual plugin code is only part of what keeps data secure. Whether the security is adequate also depends on what you need to keep it secure from and what you’re trying to protect.

      I know that people want simple answers and for the most part, they don’t understand how data security works. It’s complicated and simple answers can be misleading.

      Participants Database is not designed for the storage of sensitive material. It features adequate security for the storage of personal data, but how difficult it is to get to mostly depends on how the plugin is used and what security you have in place for your site in general. I don’t make promises that the plugin is highly secure and when people ask about it, I usually recommend they don’t use it to store sensitive information that malicious users might want to get ahold of.

      I know this is probably not reassuring, but if this is a real concern you’ll need to have a solid understanding of how WordPress security works, and take real steps to secure your site and access to the data. That will give you something to tell the client. Take a look at this article for more information: Hardening WordPress

      • Thank you so much for your quick and informative answer. Love your plugin! And thanks for the link to Hardening WordPress. I need to do tons of research!

  • Hi Rolad,

    I wonder if it is possible to have “Use DB Values in Dropdowns” option work for selected fields only?

    Regards
    Roman

    • I think this is possible, but I have not looked into it. You’d need to write a php script to customize how this works.

  • Hi Roland, I have set up the multisearch with a single search field of radio button input. Is it somehow possible to remove submit button and perform search just after selecting one of the choices?

  • Hi! 2 questions:
    1) I have a number field that is in my multi search. The search function displays a range of lowest to highest. But it only returns results that match the highest figure and none of the numbers in the range.

    2) Is there a way to exclude certain characters from search field function? People that visit my site tend to enter a comma into the search, which prevents any matches.

    Thank you so much!

    • under some circumstances, searches for ranges (numeric or dates) can fail because of the other terms in the search. This is a guess, I can’t say with certainly what is happening in your case without seeing the query.

      What fields do you have in your multisearch? Are you combining combo search and multisearch? This can cause problems if you’ve got the same field in both combo and multi search configurations.

      #2 this is an interesting question. Of course it’s possible to do this with a filter, if you’ve got some coding skills, that is the best way to deal with this. Is this for combo search? I can provide details if you want.

      • 1) I have 30 fields in the multisearch. I DO have this range field in both the combo search and multi search, but I just tested it by removing it from the combo search, purging server cache and testing the range. I still had the same issue. I was not filtering any other terms when testing the range.

        I have a total of 5 range fields in the multisearch. All of them are showing this behavior. You can see the search function at searchtinyhousevillages.com

        2) Yes, this is for the combo search. I would love some details if you are up for providing them.

        • That’s a fair number of search fields! The numeric range searches can sometimes run into problems when combined with other searches, this is a problem I’m working on, but why it wouldn’t work properly when that is the only search term, I can’t say.

          You can get some insight to what the search function is doing if you turn Participants Database debugging on (in the plugin settings under the advanced tab) and then look at the debugging log to see what the actual database query ended up being. If you do this and want me to look at queries, please email me at support@xnau.com

          As to excluding characters from the search, I got ahead of myself on that one: I have not yet set up a filter that can give you the ability to condition the search terms. I am including this in the next update to the Combo Multisearch plugin.

  • Hello,
    I am using combo search for my website purpose, i am searching two fields in my listings. The funcionallity of the addon seems ok till now (in my first testes) but the template of the multisearch its not shown correctly in my frontend, i am using this shortcode:

    [pdb_list template=multisearch suppress=true]

    What can i do to show my search correctly, i am using multisearch to search only 2 field.

    Thanks in advance

    • Now the search doesn’t seem working,
      I used the shortcode and i want to get results if only the 2 inputs i put in the 2 search field match for example if i have set to search for name and surname, i dont want to get results if i search only for the name but i want search results only if the 2 search fields match, thats why i bought this add on but now i dont understand why its not working :(

      • Take a look at the settings for the Combo Multisearch add-on, there is a global “Enable Filter Mode” that will only show a match from both search fields.

        Please include a link to your page if you want me to comment on problems with the template.

        • I have checked Enable Filter Mode but still when i search something if i fill the first search and let the other field empty i get the results, but i want the search to appear only if the 2 fields of search are filled.

        • The “filter mode” means that all of the terms submitted must match, it does not force the user to select something for all the fields.

  • Not sure if this has been asked, but can’t find it in the messages. I am trying to do the following:
    I have a database of employees. Each employee has a Badge Number and I am trying to add a Badge Number search to the site. Ideally, there will just be a search box on a page (and nothing else) and when a badge number is entered it pulls up a single result with employee information. I have tried several things including the combo multisearch, but can’t get it to work right. Does anyone know a way I can do this?

    • Take a look at this article: you don’t need Combo Multisearch for something like that…

      Searching on Only One Field

      • Hi Roland,

        Thanks for the quick response, I’ll have to see if I can get refunded for the combo search then.

        I plugged in code snippet at the top of that page and put the badge_number field in it. It now shows the list on the page, but I am wanting to just display a search and potentially have the record pop up in a modal or something.
        I have tried using pdb_single, this results in a message that just says “No results found”. I have tried pdb_search, this results in a search field that never pulls anything up when I put in a badge number…any idea of how I can accomplish this?

        Cheers,
        Nick

        • I suggest you use the “suppress” attribute to prevent the list showing anything until a search is performed, like this:

          [pdb_list search_fields=badge_number suppress=true]

          If you want to further customize the appearance of the results, you’ll need to use a custom template. Here is an article you might find helpful for that:

          Showing a Search Result as a Single Record

        • So I have attempted to use a template like you suggested and used the one in your example (due to it being exactly what I need), but the result is still coming up in a table.
          I am using: [pdb_list search=true search_fields=badge_number template="single" suppress=true]
          The template is exactly that shown here: https://xnau.com/showing-a-search-result-as-a-single-record/

          Any ideas?
          Cheers,
          Nick

        • If you are getting a table of results, then your custom template is not getting used. Be sure the name of the template file is correct and that the file is in the correct location.

          A detailed explanation of how this works can be found here:
          Using Participants Database Custom Templates

      • Hmm now it is not showing a search at all…any idea why?

        • sorry…don’t leave out the “search=true” in the shortcode.

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.