From: Heikki Levanto Date: Tue, 3 Dec 2013 15:25:55 +0000 (+0100) Subject: Minor improvement: Doesn't crash so often :-) X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=167d995add67a666df5f91bbe58a3f9084c77453;p=pazpar2-moved-to-github.git Minor improvement: Doesn't crash so often :-) --- diff --git a/src/relevance.c b/src/relevance.c index 6fe96cb..ffa31b0 100644 --- a/src/relevance.c +++ b/src/relevance.c @@ -382,6 +382,7 @@ void relevance_prepare_read(struct relevance *rel, struct reclist *reclist, float *idfvec = xmalloc(rel->vec_len * sizeof(float)); int n_clients = clients_count(); struct client * clients[n_clients]; + int clusternumber = 0; yaz_log(YLOG_LOG,"round-robin: have %d clients", n_clients); for (i = 0; i < n_clients; i++) clients[i] = 0; @@ -409,6 +410,7 @@ void relevance_prepare_read(struct relevance *rel, struct reclist *reclist, struct record_cluster *rec = reclist_read_record(reclist); if (!rec) break; + clusternumber++; w = rec->relevance_explain2; wrbuf_rewind(w); wrbuf_puts(w, "relevance = 0;\n"); @@ -493,7 +495,7 @@ void relevance_prepare_read(struct relevance *rel, struct reclist *reclist, for (record = rec->records; record; record = record->next, i++) { scores[i] = atof( getfield(record,"score") ); yaz_log(YLOG_LOG,"mergescore %d: %f", i, scores[i] ); - wrbuf_printf(w,"mergeplot %d: %f\n", record->position, 10000*scores[i] ); + wrbuf_printf(w,"mergeplot %d: %f x\n", clusternumber, 10000*scores[i] ); } qsort(scores, nclust, sizeof(float), sort_float ); for (i = 0; iposition, but something from rec that + // corresponds to the hit number, for plotting. } // merge score id = getfield(bestrecord, "id"); // clear the id, we only want the first numerical part