-/* $Id: xslt3.c,v 1.1 2005-05-01 07:17:47 adam Exp $
+/* $Id: xslt3.c,v 1.4 2005-09-13 11:51:11 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
size_t r;
ZebraService zs = start_up(0, argc, argv);
- ZebraHandle zh = zebra_open(zs);
+ ZebraHandle zh = zebra_open(zs, 0);
check_filter(zs, "xslt");
zebra_init(zh);
- zebra_set_resource(zh, "recordType", "xslt.marc1.xsl");
+ zebra_set_resource(zh, "recordType", "xslt.marcschema-one.xml");
sprintf(path, "%.200s/marc-one.xml", get_srcdir());
f = fopen(path, "rb");
record_buf[r] = '\0';
- /* for now only the first of the records in the collection is
- indexed. That can be seen as a bug */
+ /* index this one record */
init_data(zh, records_array);
/* only get hits from first record .. */
do_query(__LINE__, zh, "@attr 1=title computer", 1);
do_query(__LINE__, zh, "@attr 1=control 11224466", 1);
do_query_x(__LINE__, zh, "@attr 1=titl computer", 0, 121);
+
+
+ /* index one more time to see that we don't get dups, since
+ index.xsl has a record ID associated with them */
+ zebra_add_record(zh, record_buf, strlen(record_buf));
+
+ /* only get hits from first record .. */
+ do_query(__LINE__, zh, "@attr 1=title computer", 1);
+ do_query(__LINE__, zh, "@attr 1=control 11224466", 1);
+ do_query_x(__LINE__, zh, "@attr 1=titl computer", 0, 121);
+
+
return close_down(zh, zs, 0);
}