From a58a0ed09301d1a773ad5489fba90b9dddfb1bfd Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 13 Jun 2007 21:29:04 +0000 Subject: [PATCH] Work on bug #1172. Save result set postition for each record in a cluster. --- src/logic.c | 5 +++-- src/record.c | 8 +++++--- src/record.h | 6 ++++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/logic.c b/src/logic.c index b02deac..d0a92a8 100644 --- a/src/logic.c +++ b/src/logic.c @@ -1,4 +1,4 @@ -/* $Id: logic.c,v 1.42 2007-06-13 13:04:34 adam Exp $ +/* $Id: logic.c,v 1.43 2007-06-13 21:29:04 adam Exp $ Copyright (c) 2006-2007, Index Data. This file is part of Pazpar2. @@ -916,7 +916,8 @@ struct record *ingest_record(struct client *cl, Z_External *rec, } record = record_create(se->nmem, - service->num_metadata, service->num_sortkeys, cl); + service->num_metadata, service->num_sortkeys, cl, + record_no); mergekey_norm = (xmlChar *) nmem_strdup(se->nmem, (char*) mergekey); xmlFree(mergekey); diff --git a/src/record.c b/src/record.c index 5140abc..4dc2366 100644 --- a/src/record.c +++ b/src/record.c @@ -1,4 +1,4 @@ -/* $Id: record.c,v 1.9 2007-06-07 12:27:03 adam Exp $ +/* $Id: record.c,v 1.10 2007-06-13 21:29:04 adam Exp $ Copyright (c) 2006-2007, Index Data. This file is part of Pazpar2. @@ -19,7 +19,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: record.c,v 1.9 2007-06-07 12:27:03 adam Exp $ */ +/* $Id: record.c,v 1.10 2007-06-13 21:29:04 adam Exp $ */ #include @@ -59,7 +59,7 @@ union data_types * data_types_assign(NMEM nmem, struct record * record_create(NMEM nmem, int num_metadata, int num_sortkeys, - struct client *client) + struct client *client, int position) { struct record * record = 0; int i = 0; @@ -82,6 +82,8 @@ struct record * record_create(NMEM nmem, int num_metadata, int num_sortkeys, sizeof(union data_types*) * num_sortkeys); for (i = 0; i < num_sortkeys; i++) record->sortkeys[i] = 0; + + record->position = position; return record; } diff --git a/src/record.h b/src/record.h index 30effe6..c915442 100644 --- a/src/record.h +++ b/src/record.h @@ -1,4 +1,4 @@ -/* $Id: record.h,v 1.9 2007-06-07 12:27:03 adam Exp $ +/* $Id: record.h,v 1.10 2007-06-13 21:29:04 adam Exp $ Copyright (c) 2006-2007, Index Data. This file is part of Pazpar2. @@ -56,11 +56,13 @@ struct record { union data_types **sortkeys; // Next in cluster of merged records struct record *next; + // client result set position; + int position; }; struct record * record_create(NMEM nmem, int num_metadata, int num_sortkeys, - struct client *client); + struct client *client, int position); struct record_metadata * record_metadata_create(NMEM nmem); -- 1.7.10.4