function mresultHandleMRIds(r) {
var res = r.getResultObject();
+ resultCompiledSearch = res.compiled_search;
+ cookieManager.write(COOKIE_SEARCH, js2JSON(res.compiled_search), -1);
if(res.count != null) {
if( getOffset() == 0 ) HITCOUNT = res.count;
runEvt('result', 'hitCountReceived');
}
- cookieManager.write(COOKIE_SEARCH, js2JSON(res.compiled_search), -1);
runEvt('result', 'idsReceived', res.ids);
}
var lowHitCount = 4;
var resultFetchAllRecords = false;
+var resultCompiledSearch = null;
/* set up the event handlers */
if( findCurrentPage() == MRESULT || findCurrentPage() == RRESULT ) {
if(getHitCount() > 0)
unHideMe($('result_low_hits_msg'));
- var sreq = new Request(CHECK_SPELL, getTerm());
+ alert(js2JSON(resultCompiledSearch));
+
+ var words = [];
+ for(var key in resultCompiledSearch.searches)
+ words.push(resultCompiledSearch.searches[key].term);
+
+ var sreq = new Request(CHECK_SPELL, words.join(' '));
sreq.callback(resultSuggestSpelling);
sreq.send();
- /* XXX patch to use the search results */
-
- var words = getTerm().split(' ');
- var word;
- while( word = words.shift() ) {
- var areq = new Request(FETCH_CROSSREF, getStype(), getTerm() );
+ for(var key in resultCompiledSearch.searches) {
+ var areq = new Request(FETCH_CROSSREF, key, resultCompiledSearch.searches[key].term);
areq.callback(resultLowHitXRef);
areq.send();
}
}
function _rresultHandleIds(ids, count) {
- var json = js2JSON({ids:ids,count:count});
+ //var json = js2JSON({ids:ids,count:count});
/*
cookieManager.write(COOKIE_SRIDS, json, '+1d');
*/
ids.push(result.ids[i][0]);
}
+ resultCompiledSearch = result.compiled_search;
cookieManager.write(COOKIE_SEARCH, js2JSON(result.compiled_search), -1);
_rresultHandleIds( ids, result.count );
}