From: erickson Date: Thu, 15 Nov 2007 22:54:33 +0000 (+0000) Subject: now calling the new search query parsing method for regular bib and metabib searches... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=35edea62663daa40c29fb7a1401f3fccaa7de7b6;p=Evergreen.git now calling the new search query parsing method for regular bib and metabib searches. compiling adv. searches into new query lang. more to do.... git-svn-id: svn://svn.open-ils.org/ILS/trunk@8070 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/opac/common/js/config.js b/Open-ILS/web/opac/common/js/config.js index 58a63a6c30..aca1d7d90f 100644 --- a/Open-ILS/web/opac/common/js/config.js +++ b/Open-ILS/web/opac/common/js/config.js @@ -272,6 +272,8 @@ config.ids.altcanvas = {}; var SEARCH_MRS = 'open-ils.search:open-ils.search.metabib.multiclass:1'; var SEARCH_RS = 'open-ils.search:open-ils.search.biblio.multiclass:1'; +var SEARCH_MRS_QUERY = 'open-ils.search:open-ils.search.metabib.multiclass.query:1'; +var SEARCH_RS_QUERY = 'open-ils.search:open-ils.search.biblio.multiclass.query:1'; var FETCH_SEARCH_RIDS = "open-ils.search:open-ils.search.biblio.record.class.search:1"; var FETCH_MRMODS = "open-ils.search:open-ils.search.biblio.metarecord.mods_slim.retrieve"; var FETCH_MODS_FROM_COPY = "open-ils.search:open-ils.search.biblio.mods_from_copy"; diff --git a/Open-ILS/web/opac/skin/default/css/layout.css b/Open-ILS/web/opac/skin/default/css/layout.css index 9f5704bd59..2f170e5a54 100644 --- a/Open-ILS/web/opac/skin/default/css/layout.css +++ b/Open-ILS/web/opac/skin/default/css/layout.css @@ -82,6 +82,7 @@ table { border-collapse: collapse; } #searchbar_table { border-collapse: collapse; } .search_box_container { width: 240px; padding: 3px; }/* border: 1px solid #A0A0A0;' class='color_2'>*/ +#search_box { width: 260px; } /* ---------------------------------------------------------------------- */ diff --git a/Open-ILS/web/opac/skin/default/js/adv_global.js b/Open-ILS/web/opac/skin/default/js/adv_global.js index 1aac9acb78..c5da253b77 100644 --- a/Open-ILS/web/opac/skin/default/js/adv_global.js +++ b/Open-ILS/web/opac/skin/default/js/adv_global.js @@ -118,14 +118,14 @@ function advSubmitGlobal() { args[PARAM_LITFORM] = litforms; args[PARAM_AUDIENCE] = audiences; args[PARAM_LANGUAGE] = languages; - args[PARAM_SEARCHES] = js2JSON(searches); /* break these out */ + //args[PARAM_SEARCHES] = js2JSON(searches); /* break these out */ args[PARAM_DEPTH] = depthSelGetDepth(); args[PARAM_LOCATION] = depthSelGetNewLoc(); args[PARAM_SORT] = sortby; args[PARAM_SORT_DIR] = sortdir; args[PARAM_ADVTYPE] = ADVTYPE_MULTI; args[PARAM_STYPE] = ""; - args[PARAM_TERM] = ""; + args[PARAM_TERM] = searches; args[PARAM_AVAIL] = limit2avail; /* pubdate sorting causes a record (not metarecord) search */ @@ -146,7 +146,7 @@ function advSubmitGlobal() { function advBuildSearchBlob() { - var searches; + var searches = ''; var tbody = $('adv_global_tbody'); var rows = tbody.getElementsByTagName('tr'); @@ -162,14 +162,6 @@ function advBuildSearchBlob() { if(!term) continue; var string = ""; - - if(!searches) searches = {}; - - if(searches[stype]) - string = searches[stype].term; - else - searches[stype] = { term : "" }; - switch(contains) { case 'contains' : string += " " + term; @@ -190,10 +182,15 @@ function advBuildSearchBlob() { if(string) { string = string.replace(/'/g,' '); string = string.replace(/\\/g,' '); - searches[stype].term = string; + string = string.replace(/^\s*/,''); + string = string.replace(/\s*$/,''); + //searches[stype].term = string; + if(searches) searches += ' '; + searches += stype + ':'+ string; } } + _debug("created search query " + searches); return searches; } diff --git a/Open-ILS/web/opac/skin/default/js/mresult.js b/Open-ILS/web/opac/skin/default/js/mresult.js index ca15d60cd0..97fcd6bb21 100644 --- a/Open-ILS/web/opac/skin/default/js/mresult.js +++ b/Open-ILS/web/opac/skin/default/js/mresult.js @@ -37,11 +37,11 @@ function mresultDoSearch() { } function _mresultCollectIds() { - resultCollectSearchIds(true, SEARCH_MRS, mresultHandleMRIds ); + resultCollectSearchIds(true, SEARCH_MRS_QUERY, mresultHandleMRIds ); } function mresultCollectAdvIds() { - resultCollectSearchIds(false, SEARCH_MRS, mresultHandleMRIds ); + resultCollectSearchIds(false, SEARCH_MRS_QUERY, mresultHandleMRIds ); } diff --git a/Open-ILS/web/opac/skin/default/js/result_common.js b/Open-ILS/web/opac/skin/default/js/result_common.js index 6602165d30..3df7c48bf4 100644 --- a/Open-ILS/web/opac/skin/default/js/result_common.js +++ b/Open-ILS/web/opac/skin/default/js/result_common.js @@ -42,21 +42,11 @@ function resultCollectSearchIds( type, method, handler ) { var args = {}; if( type ) { - args.searches = {}; - args.searches[getStype()] = {}; - var term = getTerm(); - if( term ) { - term = term.replace(/'/g,' '); - term = term.replace(/\\/g,' '); - args.searches[getStype()].term = term; - } - var form = parseForm(getForm()); item_type = form.item_type; item_form = form.item_form; } else { - args.searches = JSON2js(getSearches()); item_type = (getItemType()) ? getItemType().split(/,/) : null; item_form = (getItemForm()) ? getItemForm().split(/,/) : null; } @@ -73,6 +63,7 @@ function resultCollectSearchIds( type, method, handler ) { args.limit = limit; args.offset = getOffset(); args.visibility_limit = 3000; + args.default_class = getStype(); if(sort) args.sort = sort; if(sortdir) args.sort_dir = sortdir; @@ -85,10 +76,10 @@ function resultCollectSearchIds( type, method, handler ) { if(getLitForm()) args.lit_form = getLitForm().split(/,/); if(getLanguage()) args.language = getLanguage().split(/,/); - //alert(js2JSON(args)); + _debug('Search args: ' + js2JSON(args)); + _debug('Raw query: ' + getTerm()); - _debug('SEARCH: \n' + js2JSON(args) + '\n\n'); - var req = new Request(method, args, 1); + var req = new Request(method, args, getTerm(), 1); req.callback(handler); req.send(); } @@ -184,6 +175,8 @@ function resultLowHits() { sreq.callback(resultSuggestSpelling); sreq.send(); + /* XXX patch to use the search results */ + var words = getTerm().split(' '); var word; while( word = words.shift() ) { diff --git a/Open-ILS/web/opac/skin/default/js/rresult.js b/Open-ILS/web/opac/skin/default/js/rresult.js index e5620af463..79ece56094 100644 --- a/Open-ILS/web/opac/skin/default/js/rresult.js +++ b/Open-ILS/web/opac/skin/default/js/rresult.js @@ -283,12 +283,12 @@ function rresultLaunchDrawn(id, node) { function rresultDoRecordSearch() { rresultIsPaged = true; - resultCollectSearchIds(true, SEARCH_RS, rresultFilterSearchResults ); + resultCollectSearchIds(true, SEARCH_RS_QUERY, rresultFilterSearchResults ); } function rresultDoRecordMultiSearch() { rresultIsPaged = true; - resultCollectSearchIds(false, SEARCH_RS, rresultFilterSearchResults ); + resultCollectSearchIds(false, SEARCH_RS_QUERY, rresultFilterSearchResults ); } diff --git a/Open-ILS/web/opac/skin/default/xml/common/searchbar.xml b/Open-ILS/web/opac/skin/default/xml/common/searchbar.xml index 2b6393ac34..505f6ab32b 100644 --- a/Open-ILS/web/opac/skin/default/xml/common/searchbar.xml +++ b/Open-ILS/web/opac/skin/default/xml/common/searchbar.xml @@ -28,7 +28,7 @@ - +