|
@@ -220,12 +220,18 @@ MaterioSearchApiAjax = function(){
|
|
|
};
|
|
|
|
|
|
function loadNextResultsPage(href){
|
|
|
- trace('loadNextResultsPage');
|
|
|
- var keys = href.match(/explore\/([^\/|\?]+)/);
|
|
|
+ trace('loadNextResultsPage', href);
|
|
|
+ var searchmode = href.match(/explore\/filters\//) ? 'advanced' : 'fulltext';
|
|
|
+ trace("searchmode", searchmode);
|
|
|
+ if(searchmode == 'advanced'){
|
|
|
+ var keys = href.match(/explore\/filters\/([^\/|\?]+)/);
|
|
|
+ }else{
|
|
|
+ var keys = href.match(/explore\/([^\/|\?]+)/);
|
|
|
+ }
|
|
|
var page = href.match(/\?page=([0-9]+)/);
|
|
|
var url = Drupal.settings.basePath+Drupal.settings.pathPrefix+'materio_search_api_ajax/search/'+page[1];
|
|
|
|
|
|
- loadNextPage(url, keys[1], $('.materiobase-results', _$content), '.search-results');
|
|
|
+ loadNextPage(url, keys[1], $('.materiobase-results', _$content), '.search-results', searchmode);
|
|
|
};
|
|
|
|
|
|
function loadNextActualityPage(href){
|
|
@@ -236,11 +242,15 @@ MaterioSearchApiAjax = function(){
|
|
|
loadNextPage(url, '', $('.materiobase-actuality', _$content), '.actuality-items');
|
|
|
};
|
|
|
|
|
|
- function loadNextPage(url, keys, $container, target){
|
|
|
+ function loadNextPage(url, keys, $container, target, searchmode){
|
|
|
// trace('MaterioSearchApiAjax :: loadNextPage()');
|
|
|
+
|
|
|
+ // define mode (between full text or only term selected on autocompletion)
|
|
|
+ searchmode = searchmode || "fulltext";
|
|
|
+
|
|
|
_isloadingresults = true;
|
|
|
$container.addClass('loading');
|
|
|
- $.getJSON(url, {'keys':keys}, function(json){
|
|
|
+ $.getJSON(url, {'keys':keys,'searchmode':searchmode}, function(json){
|
|
|
//trace('json', json);
|
|
|
$container.removeClass('loading');
|
|
|
addNextpage(json, target);
|