X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;ds=sidebyside;f=src%2Ffilter_zoom.cpp;h=5860e15f6806067fdc1eb9adef9a0e2ccf3ddd88;hb=0a7f68cbd61a5cd143834ee3c62da6256c8e9648;hp=8927d791c0e24858cf2afbbfc6cc4ae4be330bfb;hpb=14d2f8d7880779a2eb51fe767e41ee4afcbfe642;p=metaproxy-moved-to-github.git diff --git a/src/filter_zoom.cpp b/src/filter_zoom.cpp index 8927d79..5860e15 100644 --- a/src/filter_zoom.cpp +++ b/src/filter_zoom.cpp @@ -423,7 +423,7 @@ void yf::Zoom::Impl::configure(const xmlNode *ptr, bool test_only) "Bad attribute " + std::string((const char *) attr->name)); } - if (ccl_field.length() && cql_field.length()) + if (cql_field.length()) fieldmap[cql_field] = ccl_field; } else if (!strcmp((const char *) ptr->name, "records")) @@ -737,7 +737,10 @@ struct cql_node *yf::Zoom::Impl::convert_cql_fields(struct cql_node *cn, it = fieldmap.find(cn->u.st.index); if (it == fieldmap.end()) return cn; - cn->u.st.index = odr_strdup(odr, it->second.c_str()); + if (it->second.length()) + cn->u.st.index = odr_strdup(odr, it->second.c_str()); + else + cn->u.st.index = 0; } break; case CQL_NODE_BOOL: @@ -770,7 +773,14 @@ void yf::Zoom::Frontend::handle_search(mp::Package &package) int error = 0; const char *addinfo = 0; std::string db(sr->databaseNames[0]); - BackendPtr b = get_backend_from_databases(db, &error, &addinfo); + std::string torus_db; + size_t db_arg_pos = db.find(','); + if (db_arg_pos != std::string::npos) + torus_db = db.substr(0, db_arg_pos); + else + torus_db = db; + + BackendPtr b = get_backend_from_databases(torus_db, &error, &addinfo); if (error) { apdu_res = @@ -866,6 +876,7 @@ void yf::Zoom::Frontend::handle_search(mp::Package &package) assert(pqf_wrbuf == 0); int cerror, cpos; struct ccl_rpn_node *cn; + yaz_log(YLOG_LOG, "CCL: %s", wrbuf_cstr(ccl_wrbuf)); cn = ccl_find_str(b->sptr->ccl_bibset, wrbuf_cstr(ccl_wrbuf), &cerror, &cpos); wrbuf_destroy(ccl_wrbuf);