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. 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.

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.

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 Field Label – 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 dropdown fields, instead of showing the configured field options, the options shown in the control will be drawn from the database.
  • Show “Any” Option – for selectors, show an option that will allow for any value in the fields: this is essentially a “reset” for the selector.
  • “Any” Option Label – when the “any” option is shown, this is how it will be labeled.
  • Multiselect “Or” Mode – only for multiselect fields, 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.

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.

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 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.

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.

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 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 ]

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 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']

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

  • PHP Version: 7.3.16
    MySQL Version: 5.5.62
    Participants Database: 1.9.5.11
    Participants Database Combination Multi Search: 2.1.6

    I think something has changed since I updated to latest versions. On this page:
    https://www.gowerbonecaves.org.uk/gazetteer

    I can successfully use a search word from anywhere in the Fauna names but when confronted with more than one Fauna name containing that search word, it just selects the first one.

    e.g., a search on ‘Bear’ or ‘Ursus’ just selects those records with ‘Bear – Ursus sp.’ from the following possibilities:
    Bear – Ursus sp.
    Brown Bear – Ursus arctos
    Cave Bear – Ursus spelauys

    I am sure it was able to do this before. Ideally, I would be able to flag records containing any of the above on the search words list above? Can you please advise. Many thanks

    • Best way to analyze your results is to turn plugin debugging on (Participants Database settings under the advanced tab), run a search, then go to the debugging log and see what the database query for a particular search is.

      Also, the go-to general fix for issues that come up after an update is to clear your server cache.

      • Have cleared cache to no effect but these are the database queries for ‘Bear’ and ‘Ursus”

        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 “%Bear%” OR p.parish LIKE “%Bear%” OR p.human_activity LIKE “%\”Bear\”%” OR p.fauna LIKE “%\”Bear – Ursus sp.\”%”) ORDER BY p.site_name ASC

        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 “%Ursus%” OR p.parish LIKE “%Ursus%” OR p.human_activity LIKE “%\”Ursus\”%” OR p.fauna LIKE “%\”Bear – Ursus sp.\”%”) ORDER BY p.site_name ASC

        The Fauna dropdown list contains 3 ‘Bear’ options (listed above) all of which may be found in various records. It just seems to want to search for just the first one it finds. Is this what you would have expected or have I missed something?

        Many thanks for yiou help

        • Thanks for the clarification. It looks like it’s doing something it shouldn’t: it’s finding a specific value from the field definition instead of just searching for the word. This is why the word “bear” ends up as “Bear – Ursus sp.” in the query.

          I will issue an update to Combo Multisearch that fixes this.

        • Many thanks Roland

          Works perfectly

  • Hi.

    I just purchased a Combo MultiSearch and an Image Expansion Kit. On the order details page, as I downloaded these two, I noted that the Chrome on my Mac with the latest OS warns that these files are dangerous and that the browser is asking whether I should discard them. Should I ignore the message or what?

    Regards,

    • Yes, Chrome will do that sometimes because the files contain javascript and that’s considered dangerous. It’s just a warning, as long as you trust the source, you can ignore it and download.

      • Hi Roland,

        My installation is done. I’ve been toying with configuration and I’m experiencing the same issue below raised by RWM. I used Safari, Chrome and Firefox to see if it’s a browser issue but still the same. Looks like you’re looking into it but meanwhile what’d be a workaround to delete a field once it’s added in the multi-search fields configuration?

        • This was fixed in the last release, so I’m not sure what’s going on for you there. Probably another plugin messing up the javascript. What exactly is happening when you click the field delete icon?

        • Then, may I try the latest release? The version I downloaded for my purchase was 1.9.5.9. This doesn’t seem to be the latest and I don’t see the update button for the plugin on my WP dashboard. Where can I download the latest releases?

        • The update will show up in your Plugins page. Make sure it’s refreshed? I don’t know why it would not appear. Should be version 1.9.5.10

        • You may close this case. I can see the confirmation dialogue now and delete the fields added in the configuration screen. I was preoccupied with the add-on and I wrongly thought the version no was for the add-on, not for the plugin itself. After my update of the plugin, it’s working as expected now. Sorry and thanks.

          One question on search performance of this plugin. I’m building a database with potentially 10K records with each record consisting of around 10 fields with 2 of them being image ones. Traffic-wise, I think I can have hundreds of thousands of users within 2 years but I’m not sure how much traffic it would generate to the database. Against this scenario, should I be concerned about search performance hit?

        • The performance of something like that is really going to depend on your server configuration. The plugin is reasonably efficient, but the handling of the database queries is up to the server.

  • In the multi-fields ui, there’s not a way to delete a field once you add it to the list. A message appears below in the current page text asking if you want to remove the field, but there’s no dialog box to confirm the deletion.

    • Yes, I’ve heard about this problem, not sure specifically what causes it or what the problem is other than it’s another plugin or your theme. I don’t see the problem here, so not sure how to fix. I’m looking into it.

  • Still setting the program up and not being familiar with sql or databases in general I’m working my way through a litany of silly little errors. Fortunately after careful reading of your various tutorials and other documentation and a few hits and misses I’ve managed to implement a lot of the goals we set out to do. (a side result has also been getting some understanding of other areas in WordPress that had eluded me)

    I’ve got combo multi-search that works well but want to drop one of the fields. I get the Remove the Record ID (id) field? prompt but not the option to confirm or answer Yes.
    I’ve gone through each of the three settings menus and the Multi Search Fields menu trying a number of options but can’t seem to get it to work..

    • The usual reason this doesn’t work is the theme or another plugin is altering the display of the confirmation box. I’m not sure what the fix for this is, the confirmation box uses shared code and so it’s not uncommon for other plugins/themes to use the code. If they are not careful with their CSS, however, it can result in problems like this.

      If you’re willing, email me an admin login so I can check it myself… support@xnau.com. This would help me develop some defense against this problem for other users.

      You can sometimes get away with just hitting “enter” to confirm the delete even if the button is not visible.

  • Null Select seems to be no longer displayed in the dropdown menus which is my prefered default option. Please see Archaeology menu in:
    https://www.gowerbonecaves.org.uk/gazetteer

    This is how its field options should begin:
    null_select::Unknown, Human Remains, Inhumation, …….

    • Check the multisearch field configuration for that field, enable the Show “Any” Option, and set the “Any” Option Label to “Unknown”

  • findobc.com/status/

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.