In the script part used by the global search, the search string is not escaped. While this allows you to add address line arguments directly to your search (searching for "magic missile&f=spell" does filter spells), it does not for example allow you to search for "D&D" since the & is interpreted as a special URL character. You should change the code line for the search term in $('#es-form-global').submit and $("#es-form-main").submit to something like:
var searchTerm = encodeURIComponent($(this).find('.es-form-field-query').val());
Also, when clicking the filter options, a new search is triggered. That search uses the old search parameters, but in HTML encoding, so a search for "D%26D" (or "D&D", after the fix above) results in a new search string of "D&D". To fix this, you could use a trick like this in redirectOnFilter(e):
var searchTerm = encodeURIComponent($('<textarea>') .text($('.b-breadcrumb-item').last().find('span').text()) .val());
That does not fix the back end side problem that a search for "D&D" results in a search for only "D", but it does fix the search on the browser side.
Edit: There was no need to mix javascript and jQuery.
In the script part used by the global search, the search string is not escaped. While this allows you to add address line arguments directly to your search (searching for "magic missile&f=spell" does filter spells), it does not for example allow you to search for "D&D" since the & is interpreted as a special URL character. You should change the code line for the search term in $('#es-form-global').submit and $("#es-form-main").submit to something like:
Also, when clicking the filter options, a new search is triggered. That search uses the old search parameters, but in HTML encoding, so a search for "D%26D" (or "D&D", after the fix above) results in a new search string of "D&D". To fix this, you could use a trick like this in redirectOnFilter(e):
var searchTerm = encodeURIComponent($('<textarea>')
.text($('.b-breadcrumb-item').last().find('span').text())
.val());
That does not fix the back end side problem that a search for "D&D" results in a search for only "D", but it does fix the search on the browser side.
Edit: There was no need to mix javascript and jQuery.