projects
/
yaz-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
55af198
)
Check for presense of numFound.
author
Dennis Schafroth
<dennis@indexdata.com>
Thu, 26 Aug 2010 14:31:43 +0000
(16:31 +0200)
committer
Dennis Schafroth
<dennis@indexdata.com>
Thu, 26 Aug 2010 14:31:43 +0000
(16:31 +0200)
src/solr.c
patch
|
blob
|
history
diff --git
a/src/solr.c
b/src/solr.c
index
7a13940
..
d5afb4a
100644
(file)
--- a/
src/solr.c
+++ b/
src/solr.c
@@
-93,7
+93,7
@@
static void yaz_solr_decode_result_docs(ODR o, xmlNodePtr ptr, Odr_int start, Z_
}
}
}
}
-static void yaz_solr_decode_result(ODR o, xmlNodePtr ptr, Z_SRW_searchRetrieveResponse *sr) {
+static int yaz_solr_decode_result(ODR o, xmlNodePtr ptr, Z_SRW_searchRetrieveResponse *sr) {
Odr_int start = 0;
struct _xmlAttr *attr;
for (attr = ptr->properties; attr; attr = attr->next)
Odr_int start = 0;
struct _xmlAttr *attr;
for (attr = ptr->properties; attr; attr = attr->next)
@@
-101,11
+101,16
@@
static void yaz_solr_decode_result(ODR o, xmlNodePtr ptr, Z_SRW_searchRetrieveRe
if (!strcmp((const char *) attr->name, "numFound")) {
sr->numberOfRecords = odr_intdup(o, odr_atoi(
(const char *) attr->children->content));
if (!strcmp((const char *) attr->name, "numFound")) {
sr->numberOfRecords = odr_intdup(o, odr_atoi(
(const char *) attr->children->content));
- } else if (!strcmp((const char *) attr->name, "start")) {
+ }
+ else if (!strcmp((const char *) attr->name, "start")) {
start = odr_atoi((const char *) attr->children->content);
}
}
start = odr_atoi((const char *) attr->children->content);
}
}
- yaz_solr_decode_result_docs(o, ptr, start, sr);
+ if (sr->numberOfRecords && *sr->numberOfRecords > 0)
+ yaz_solr_decode_result_docs(o, ptr, start, sr);
+ if (sr->numberOfRecords)
+ return 0;
+ return -1;
}
static Z_AttributeList *yaz_solr_use_atttribute_create(ODR o, const char *name) {
}
static Z_AttributeList *yaz_solr_use_atttribute_create(ODR o, const char *name) {
@@
-142,7
+147,7
@@
Z_FacetField *yaz_solr_decode_facet_field(ODR o, xmlNodePtr ptr, Z_SRW_searchRet
return facet_field;
}
return facet_field;
}
-static void yaz_solr_decode_facet_counts(ODR o, xmlNodePtr root, Z_SRW_searchRetrieveResponse *sr) {
+static int yaz_solr_decode_facet_counts(ODR o, xmlNodePtr root, Z_SRW_searchRetrieveResponse *sr) {
xmlNodePtr ptr;
for (ptr = root->children; ptr; ptr = ptr->next)
{
xmlNodePtr ptr;
for (ptr = root->children; ptr; ptr = ptr->next)
{
@@
-166,6
+171,7
@@
static void yaz_solr_decode_facet_counts(ODR o, xmlNodePtr root, Z_SRW_searchRet
break;
}
}
break;
}
}
+ return 0;
}
static void yaz_solr_decode_facets(ODR o, xmlNodePtr ptr, Z_SRW_searchRetrieveResponse *sr) {
}
static void yaz_solr_decode_facets(ODR o, xmlNodePtr ptr, Z_SRW_searchRetrieveResponse *sr) {