return 0;
}
+static int is_SRW(void)
+{
+ if (!conn)
+ {
+ printf("Not connected yet\n");
+ return 1;
+ }
+ if (protocol == PROTO_HTTP && yaz_matchstr(sru_method, "solr"))
+ {
+ printf("Not supported by SRW\n");
+ return 1;
+ }
+ return 0;
+}
+
+
static int cmd_update_common(const char *arg, int version);
static int cmd_update(const char *arg)
}
else
{
- /** look for result node */
+ /** look for result (required) and facets node (optional) */
+ int rc_result = -1;
+ int rc_facets = 0;
for (ptr = root->children; ptr; ptr = ptr->next)
{
if (ptr->type == XML_ELEMENT_NODE &&
!strcmp((const char *) ptr->name, "result"))
- yaz_solr_decode_result(o, ptr, sr);
+ rc_result = yaz_solr_decode_result(o, ptr, sr);
if (match_xml_node_attribute(ptr, "lst", "name", "facet_counts"))
- yaz_solr_decode_facet_counts(o, ptr, sr);
- }
- if (!ptr)
- {
- ret = -1;
+ rc_facets = yaz_solr_decode_facet_counts(o, ptr, sr);
}
+ ret = rc_result + rc_facets;
}
}
if (doc)