Change encoding mergekey fields
authorAdam Dickmeiss <adam@indexdata.dk>
Thu, 10 Dec 2009 11:55:29 +0000 (12:55 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Thu, 10 Dec 2009 11:55:29 +0000 (12:55 +0100)
Change encoding so harmonize with the "old" marc21.xsl mergekey
scheme. That is field and value pairs separated by space and with
no trailing space.

src/logic.c

index 57f36b4..1d34bee 100644 (file)
@@ -897,15 +897,15 @@ static int get_mergekey_from_doc(xmlDoc *doc, xmlNode *root, const char *name,
                             service->mergekey_pct,
                             (const char *) value, 0);
                     
+                    if (wrbuf_len(norm_wr) > 0)
+                        wrbuf_puts(norm_wr, " ");
                     wrbuf_puts(norm_wr, name);
-                    wrbuf_puts(norm_wr, "=");
                     while ((norm_str =
                             pp2_relevance_token_next(prt)))
                     {
                         if (*norm_str)
                         {
-                            if (wrbuf_len(norm_wr))
-                                wrbuf_puts(norm_wr, " ");
+                            wrbuf_puts(norm_wr, " ");
                             wrbuf_puts(norm_wr, norm_str);
                         }
                     }