sru_z3950: allow CCL in SRU search MP-606
authorAdam Dickmeiss <adam@indexdata.dk>
Mon, 13 Apr 2015 07:35:45 +0000 (09:35 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Mon, 13 Apr 2015 07:35:45 +0000 (09:35 +0200)
Makes the sru_z3950 filter convert to CCL queries if query type
"ccl" is used, eg ?query=water&queryType=ccl&... for SRU 2.0.

src/filter_sru_to_z3950.cpp

index 262b936..51e14fe 100644 (file)
@@ -923,6 +923,15 @@ int yf::SRUtoZ3950::Impl::z3950_build_query(
 
         return 0;
     }
+
+    if (!strcmp(req->queryType, "ccl"))
+    {
+        z_query->which = Z_Query_type_2;
+        z_query->u.type_2 = odr_create_Odr_oct(odr_en, req->query,
+                                               strlen(req->query));
+        return 0;
+    }
+
     return YAZ_SRW_MANDATORY_PARAMETER_NOT_SUPPLIED;
 }