X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fsolr.c;h=dac858736006fdad4bc9d558859d96bcbb69b9df;hp=eaf822c65777b3feb5c72c2e9c101f31247cfe09;hb=83fe7a135733a28f6baecbfb054271163e8f46f6;hpb=1ab314f533e2942e0898ad5fda346a48312b351a diff --git a/src/solr.c b/src/solr.c index eaf822c..dac8587 100644 --- a/src/solr.c +++ b/src/solr.c @@ -12,6 +12,7 @@ #include #include #include +#include #include "sru-p.h" @@ -75,10 +76,12 @@ int yaz_solr_decode_response(ODR o, Z_HTTP_Response *hres, Z_SRW_PDU **pdup) odr_intdup(o, odr_atoi( (const char *) attr->children->content)); + yaz_log(YLOG_DEBUG, "SOLR total results: %d ", atoi( attr->children->content)); } else if (!strcmp((const char *) attr->name, "start")) { start = odr_atoi((const char *) attr->children->content); + yaz_log(YLOG_DEBUG, "SOLR start: %d ", atoi( attr->children->content)); } } } @@ -92,6 +95,7 @@ int yaz_solr_decode_response(ODR o, Z_HTTP_Response *hres, Z_SRW_PDU **pdup) for (node = ptr->children; node; node = node->next) if (node->type == XML_ELEMENT_NODE) sr->num_records++; + yaz_log(YLOG_DEBUG, "SOLR results in response: %d ", sr->num_records); sr->records = odr_malloc(o, sizeof(*sr->records) * sr->num_records); @@ -113,7 +117,9 @@ int yaz_solr_decode_response(ODR o, Z_HTTP_Response *hres, Z_SRW_PDU **pdup) record->recordData_buf = odr_malloc(o, buf->use + 1); memcpy(record->recordData_buf, buf->content, buf->use); record->recordData_buf[buf->use] = '\0'; - record->recordPosition = odr_intdup(o, start + offset); + // TODO Solve the real problem: Making the recordPosition 1-based due to "funny" code in zoom-sru + record->recordPosition = odr_intdup(o, start + offset + 1); + yaz_log(YLOG_DEBUG, "SOLR pos=" ODR_INT_PRINTF, *record->recordPosition); xmlBufferFree(buf);