Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Need help setting up a search › Reply To: Need help setting up a search
Hi,
1. The default search autocomplete and suggestions source is set to Google API, which unfortunately does not consider the currently active site, because it’s a free service. On the upside it’s extremely fast (as it runs on google servers), on the downside it’s not always relevant.
You can change the sources of these of course, please check this documentation how to do that.
2. It is intended behavior, there is no option for that unfortunately. However using a custom code it might be possible. Try adding this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!
add_action('wp_footer', 'asp_show_default_results_on_empty');
function asp_show_default_results_on_empty() {
?>
<script>
jQuery(function($){
$('.proclose svg').on('click', function(){
var $s = $(this).closest('.asp_m');
var id = $s.data('id');
var inst = $s.data('instance');
if ( $s.find('input.orig').val() != '' )
setTimeout(function(){
ASP.api(id, inst, 'searchFor', '');
}, 300);
});
});
</script>
<?php
}
This is not the best approach, as it won’t clear the filters, only the input field, and only if there was a search phrase present, but it should work for most cases.