Guided search, Keyword search and Current Search are ajaxified indeed, but the ajax search results block is not loading any content.

Comments

milos.kroulik’s picture

I have the same problem. Maybe, we are missing something. Can you please point us in the right direction? In addition, if I assign Ajaxified search results to some region, how can I hide the original results? Thanks in advance.

spielerds’s picture

In the faceted_ajax_search.js file the first function looks like this

Drupal.faceted_ajax_search.ajax_success_event = function(result) {
  $('#wrapper_faceted_ajax_result_region').hide();
  $('#wrapper_faceted_ajax_result_region').html(result.result);
  $('#wrapper_faceted_ajax_result_region').fadeIn('slow');

  for (var region in result.regions) {
    $('#faceted_ajax_search_wrapper_' + region).hide();
    $('#faceted_ajax_search_wrapper_' + region).html(result.regions[region]);
    $('#faceted_ajax_search_wrapper_' + region).fadeIn('slow');
    Drupal.attachBehaviors('#faceted_ajax_search_wrapper_' + region);
  }
  
  Drupal.attachBehaviors('#wrapper_faceted_ajax_result_region');
}

You have to change it like this

Drupal.faceted_ajax_search.ajax_success_event = function(result) {
  for (var region in result.regions) {
    $('#faceted_ajax_search_wrapper_' + region).hide();
    $('#faceted_ajax_search_wrapper_' + region).html(result.regions[region]);
    $('#faceted_ajax_search_wrapper_' + region).fadeIn('slow');
    Drupal.attachBehaviors('#faceted_ajax_search_wrapper_' + region);
  }
  
  $('#wrapper_faceted_ajax_result_region').hide();
  $('#wrapper_faceted_ajax_result_region').html(result.result);
  $('#wrapper_faceted_ajax_result_region').fadeIn('slow');
  
  Drupal.attachBehaviors('#wrapper_faceted_ajax_result_region');
}

It worked for me...

v8powerage’s picture

It works, but when you use keyword search 'within results' the previous search is not cleared and as a result we have two results pages displayed in block.

Also you can't clear search results, clicking 'x' doesn't do anyhing.

Both issues happens when you use pager to go to next page of results, when staying at first one, everything is ok.

itarato’s picture

Hi,

Sorry for procrastinating the answer. I think the omitted keyword search was in a previous version. Now I checked and it works. If it still has problems, please try it without the module, maybe the search index is not complete. If it's not the problem, let me know, I'll try to make a better support now :)

Thanks,
Peter

itarato’s picture

Status: Active » Closed (fixed)
jjoseph’s picture

Status: Closed (fixed) » Active

After sufficiently checking solutions posted here and search indexes, I conclude that I am currently having this same issue.

Thank you for your aid.

whitelancer’s picture

The reason you're getting duplicate results is because this mod is designed to load the results into its own block. You can try overriding that to use your search page, the way I described in http://drupal.org/node/973200#comment-3741212.

To combat the 'not loading default page' problem, I ended up changing the handler slightly, too, to this:

Drupal.behaviors.faceted_ajax_search = function(context) {
$('.block-faceted_search_ui a', context).each(function(){
$(this).click(function(){
var href = $(this).attr('href');
// If link doesn not contain the word: results, it means it points to the starter page, so don't intercept this link
if (href.toString().match(/results/gi)) {
$('.block-faceted_search_ui').prepend('

');
$.ajax({
type: 'POST',
url: href,
data: 'faceted_ajax_search=1',
dataType: 'json',
success: Drupal.faceted_ajax_search.ajax_success_event
});
return false;

} // end if href.match(/results...

});
});

Essentially, I flipped the test on the href so what I get is a non-ajax load of the product page (which is what should happen if you click the last "X" to remove your filtering searches...) and anytime the '/results/' regex is found, it uses ajax.

May not be perfect, but it seems to work for me so far. HTH.

itarato’s picture

Status: Active » Postponed (maintainer needs more info)

I see this ticket growing and growing. Let's stick with the original problem: no results in the results block.
I installed the module on a new-clean D6 site and it worked. I've been trying some edge cases but can't reproduce it. If the problem still exist (no result in the result block), please let me know the details (where the blocks are, what content you have ...) the more info the better. Thanks!