How to Change the Request URL Format for Widgets Searches

Question

I noticed that on your demo that when more than one facet input is selected, the URL uses
brackets:

http://tutorial.discoverysearchengine.com/nomap.html#condition[]=0&...

Our app server considers brackets as in invalid variable name, making
it impossible for us to use the facet input.

Can we use a traditional URL format? For example:

&condition=1,2

Answer

Our jQuery widgets use the default options for this serialization which use the bracket format that is popular with recent web frameworks. If you wish to use the traditional format (one param for each distinct value) you can override jQuery's options.

All ajax calls made by the widgets go through $.ajax (http://api.jquery.com/jQuery.ajax/) and thus their default values can be changed via $.ajaxSetup (http://api.jquery.com/jQuery.ajaxSetup).

Concretely you are seeing this:

?condition[]=0&condition[]=1

Add the following JavaScript above the widget setup:

$.ajaxSetup({
  traditional: true
});

And you should see this:

?condition=0&condition=1