[open-ils-commits] r8991 - trunk/Open-ILS/web/opac/skin/default/js
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Mar 12 12:13:32 EDT 2008
Author: erickson
Date: 2008-03-12 11:40:11 -0400 (Wed, 12 Mar 2008)
New Revision: 8991
Modified:
trunk/Open-ILS/web/opac/skin/default/js/mresult.js
trunk/Open-ILS/web/opac/skin/default/js/result_common.js
trunk/Open-ILS/web/opac/skin/default/js/rresult.js
Log:
updated low-hit spellcheck and authority check to honor multi-class search calls
Modified: trunk/Open-ILS/web/opac/skin/default/js/mresult.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/mresult.js 2008-03-12 15:39:20 UTC (rev 8990)
+++ trunk/Open-ILS/web/opac/skin/default/js/mresult.js 2008-03-12 15:40:11 UTC (rev 8991)
@@ -47,11 +47,12 @@
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);
}
Modified: trunk/Open-ILS/web/opac/skin/default/js/result_common.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/result_common.js 2008-03-12 15:39:20 UTC (rev 8990)
+++ trunk/Open-ILS/web/opac/skin/default/js/result_common.js 2008-03-12 15:40:11 UTC (rev 8991)
@@ -4,6 +4,7 @@
var lowHitCount = 4;
var resultFetchAllRecords = false;
+var resultCompiledSearch = null;
/* set up the event handlers */
if( findCurrentPage() == MRESULT || findCurrentPage() == RRESULT ) {
@@ -171,16 +172,18 @@
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();
}
Modified: trunk/Open-ILS/web/opac/skin/default/js/rresult.js
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/js/rresult.js 2008-03-12 15:39:20 UTC (rev 8990)
+++ trunk/Open-ILS/web/opac/skin/default/js/rresult.js 2008-03-12 15:40:11 UTC (rev 8991)
@@ -223,7 +223,7 @@
}
function _rresultHandleIds(ids, count) {
- var json = js2JSON({ids:ids,count:count});
+ //var json = js2JSON({ids:ids,count:count});
/*
cookieManager.write(COOKIE_SRIDS, json, '+1d');
*/
@@ -300,6 +300,7 @@
ids.push(result.ids[i][0]);
}
+ resultCompiledSearch = result.compiled_search;
cookieManager.write(COOKIE_SEARCH, js2JSON(result.compiled_search), -1);
_rresultHandleIds( ids, result.count );
}
More information about the open-ils-commits
mailing list