From: Jakub Skoczen Date: Thu, 22 Mar 2007 16:04:59 +0000 (+0000) Subject: filter parameter added for the search command X-Git-Tag: stable.27032007~9 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=69e061e75cc9a8d0b3357694baf661f13d2c803e;p=pazpar2-moved-to-github.git filter parameter added for the search command --- diff --git a/www/pz2_js/pz2.js b/www/pz2_js/pz2.js index e6c95d2..c2bbb41 100644 --- a/www/pz2_js/pz2.js +++ b/www/pz2_js/pz2.js @@ -113,7 +113,7 @@ pz2.prototype = { } ); }, - search: function(query, num, sort) + search: function(query, num, sort, filter) { clearTimeout(__myself.statTimer); clearTimeout(__myself.showTimer); @@ -127,9 +127,14 @@ pz2.prototype = { __myself.currQuery = query; else throw new Error("You need to supply query to the search command"); - + + if( filter !== undefined ) + var searchParams = { "command": "search", "session": __myself.sessionID, "query": __myself.currQuery, "filter": filter }; + else + var searchParams = { "command": "search", "session": __myself.sessionID, "query": __myself.currQuery }; + $.get( __myself.pz2String, - { "command": "search", "session": __myself.sessionID, "query": __myself.currQuery }, + searchParams, function(data) { if ( data.getElementsByTagName("status")[0].childNodes[0].nodeValue == "OK" ) { __myself.searchStatusOK = true; @@ -309,6 +314,11 @@ pz2.prototype = { "name": terms[j].getElementsByTagName("name")[0].childNodes[0].nodeValue, "freq": terms[j].getElementsByTagName("frequency")[0].childNodes[0].nodeValue, } + + var termIdNode = terms[j].getElementsByTagName("id"); + if(terms[j].getElementsByTagName("id").length) + term["id"] = termIdNode[0].childNodes[0].nodeValue; + termList[listName][j] = term; } }