From: Adam Dickmeiss Date: Mon, 30 Jul 2012 12:07:19 +0000 (+0200) Subject: zoom: New database arg: torus_url X-Git-Tag: v1.3.39~6 X-Git-Url: http://jira.indexdata.com/?a=commitdiff_plain;h=dd21227b80709993b132d073d3276e875f54fca4;p=metaproxy-moved-to-github.git zoom: New database arg: torus_url This is the a way fully specify the URL of the torus record to use. When in use, the udb and realm are not in use (unless %realm and %udb is given in the torus_url!). Thus, this overrides configuration. --- diff --git a/src/filter_zoom.cpp b/src/filter_zoom.cpp index 9032bfc..b337b60 100644 --- a/src/filter_zoom.cpp +++ b/src/filter_zoom.cpp @@ -129,6 +129,7 @@ namespace metaproxy_1 { int *error, char **addinfo, mp::odr &odr, + std::string torus_url, std::string &torus_db, std::string &realm); void handle_present(mp::Package &package); @@ -1099,6 +1100,8 @@ yf::Zoom::BackendPtr yf::Zoom::Frontend::get_backend_from_databases( } else if (!strcmp(name, "realm")) realm = value; + else if (!strcmp(name, "torus_url")) + torus_url = value; else if (name[0] == 'x' && name[1] == '-') { out_names[no_out_args] = name; @@ -1137,8 +1140,8 @@ yf::Zoom::BackendPtr yf::Zoom::Frontend::get_backend_from_databases( } if (torus_db.compare("IR-Explain---1") == 0) - return explain_search(package, database, error, addinfo, odr, torus_db, - realm); + return explain_search(package, database, error, addinfo, odr, torus_url, + torus_db, realm); SearchablePtr sptr; @@ -1830,6 +1833,7 @@ yf::Zoom::BackendPtr yf::Zoom::Frontend::explain_search(mp::Package &package, int *error, char **addinfo, mp::odr &odr, + std::string torus_url, std::string &torus_db, std::string &realm) { @@ -1856,7 +1860,6 @@ yf::Zoom::BackendPtr yf::Zoom::Frontend::explain_search(mp::Package &package, else if (query->which == Z_Query_type_104 && query->u.type_104->which == Z_External_CQL) { - std::string torus_url = m_p->torus_searchable_url; std::string torus_query(query->u.type_104->u.cql); xmlDoc *doc = mp::get_searchable(package, torus_url, "", torus_query, diff --git a/src/torus.cpp b/src/torus.cpp index e286adf..bd0a63b 100644 --- a/src/torus.cpp +++ b/src/torus.cpp @@ -42,15 +42,6 @@ xmlDoc *mp::get_searchable(mp::Package &package, found = url_template.find("%query"); if (found != std::string::npos) url_template.replace(found, 6, mp::util::uri_encode(query)); - else - { - if (db.length() == 0) - { - package.log("zoom", YLOG_WARN, - "%query not defined in