-/* $Id: record.c,v 1.3 2007-04-23 12:33:00 marc Exp $
+/* $Id: record.c,v 1.4 2007-04-24 13:50:07 marc Exp $
Copyright (c) 2006-2007, Index Data.
This file is part of Pazpar2.
02111-1307, USA.
*/
-/* $Id: record.c,v 1.3 2007-04-23 12:33:00 marc Exp $ */
+/* $Id: record.c,v 1.4 2007-04-24 13:50:07 marc Exp $ */
#include <string.h>
record->metadata
= nmem_malloc(nmem,
sizeof(struct record_metadata*) * num_metadata);
- memset(record->metadata, 0,
- sizeof(struct record_metadata*) * num_metadata);
+ //memset(record->metadata, 0,
+ //(( sizeof(struct record_metadata*) * num_metadata);
record->sortkeys
= nmem_malloc(nmem,
sizeof(union data_types*) * num_sortkeys);
- memset(record->metadata, 0,
- sizeof(union data_types*) * num_sortkeys);
+ //memset(record->metadata, 0,
+ // sizeof(union data_types*) * num_sortkeys);
return record;
-/* $Id: test_record.c,v 1.1 2007-04-23 12:33:00 marc Exp $
+/* $Id: test_record.c,v 1.2 2007-04-24 13:50:07 marc Exp $
Copyright (c) 2006-2007, Index Data.
This file is part of Pazpar2.
struct record_metadata * tmp_md = 0;
tmp_md = record_metadata_insert(nmem, &(record->metadata[0]), data_text);
YAZ_CHECK(tmp_md);
- tmp_md = record_metadata_insert(nmem, &tmp_md, data_text);
+ YAZ_CHECK(0 == record->metadata[0]->next);
+
+ tmp_md = record_metadata_insert(nmem, &(record->metadata[0]->next),
+ data_text);
YAZ_CHECK(tmp_md);
+ YAZ_CHECK(record->metadata[0]->next);
YAZ_CHECK(record_add_metadata_field_id(nmem, record, 3, data_num));
+ YAZ_CHECK(0 == record->metadata[3]->next);
YAZ_CHECK(record_add_metadata_field_id(nmem, record, 3, data_num));
+ YAZ_CHECK(record->metadata[3]->next);
YAZ_CHECK(record_add_metadata(nmem, record, service, "author", data_text));
+ YAZ_CHECK(0 == record->metadata[1]->next);
YAZ_CHECK(record_add_metadata(nmem, record, service, "author", data_text));
+ YAZ_CHECK(record->metadata[1]->next);
YAZ_CHECK(record_assign_sortkey_field_id(nmem, record, 0, data_text));
YAZ_CHECK(record_assign_sortkey_field_id(nmem, record, 1, data_text));
YAZ_CHECK(record_assign_sortkey_field_id(nmem, record, 2, data_num));
+
YAZ_CHECK(record_assign_sortkey(nmem, record, service, "relevance", data_text));
YAZ_CHECK(record_assign_sortkey(nmem, record, service, "title", data_text));
YAZ_CHECK(record_assign_sortkey(nmem, record, service, "year", data_num));
-/* $Id: test_relevance.c,v 1.7 2007-04-23 12:33:00 marc Exp $
+/* $Id: test_relevance.c,v 1.8 2007-04-24 13:50:07 marc Exp $
Copyright (c) 2006-2007, Index Data.
This file is part of Pazpar2.
//int total = 0;
struct relevance *rel = 0;
- struct client *client = 0;
+ //struct client *client = 0;
rel = relevance_create(nmem, queryterms, numrecs);
YAZ_CHECK(record);
// why on earth do we have a client dangeling from the record ??
- record->client = client;
+ // record->client = client;
char * bla = "blabla";
union data_types data_text;
YAZ_CHECK(record_assign_sortkey(nmem, record, service, "title", data_text));
YAZ_CHECK(record_assign_sortkey(nmem, record, service, "year", data_num));
+
+