Ignore this.
[pazpar2-moved-to-github.git] / src / logic.c
index bb10b78..c9a0f67 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: logic.c,v 1.34 2007-06-01 10:38:08 adam Exp $
+/* $Id: logic.c,v 1.40 2007-06-11 12:08:23 adam Exp $
    Copyright (c) 2006-2007, Index Data.
 
 This file is part of Pazpar2.
@@ -72,6 +72,8 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "settings.h"
 #include "normalize7bit.h"
 
+#define TERMLIST_HIGH_SCORE 25
+
 #define MAX_CHUNK 15
 
 // Note: Some things in this structure will eventually move to configuration
@@ -79,8 +81,7 @@ struct parameters global_parameters =
 {
     "",
     "",
-    "",
-    "",
+    "", 
     0,
     0, /* dump_records */
     0, /* debug_mode */
@@ -144,7 +145,8 @@ static void add_facet(struct session *s, const char *type, const char *value)
 
         s->termlists[i].name = nmem_strdup(s->nmem, type);
         s->termlists[i].termlist 
-            = termlist_create(s->nmem, s->expected_maxrecs, 15);
+            = termlist_create(s->nmem, s->expected_maxrecs,
+                              TERMLIST_HIGH_SCORE);
         s->num_termlists = i + 1;
     }
     termlist_insert(s->termlists[i].termlist, value);
@@ -502,9 +504,7 @@ char *search(struct session *se, char *query, char *filter)
     }
 
     for (cl = se->clients; cl; cl = client_next_in_session(cl))
-    {
         client_prep_connection(cl);
-    }
 
     return 0;
 }
@@ -858,38 +858,6 @@ void start_proxy(void)
     http_set_proxyaddr(hp, ser->myurl ? ser->myurl : "");
 }
 
-void start_zproxy(void)
-{
-    struct conf_server *ser = global_parameters.server;
-
-    if (*global_parameters.zproxy_override){
-        yaz_log(YLOG_LOG, "Z39.50 proxy  %s", 
-                global_parameters.zproxy_override);
-        return;
-    }
-
-    else if (ser->zproxy_host || ser->zproxy_port)
-    {
-        char hp[128] = "";
-
-        strcpy(hp, ser->zproxy_host ? ser->zproxy_host : "");
-        if (ser->zproxy_port)
-        {
-            if (*hp)
-                strcat(hp, ":");
-            else
-                strcat(hp, "@:");
-
-            sprintf(hp + strlen(hp), "%d", ser->zproxy_port);
-        }
-        strcpy(global_parameters.zproxy_override, hp);
-        yaz_log(YLOG_LOG, "Z39.50 proxy  %s", 
-                global_parameters.zproxy_override);
-
-    }
-    else
-        return;
-}
 
 // Master list of connections we're handling events to
 static IOCHAN channel_list = 0; 
@@ -929,8 +897,7 @@ struct record *ingest_record(struct client *cl, Z_External *rec,
     }
 
     record = record_create(se->nmem, 
-                           service->num_metadata, service->num_sortkeys);
-    record_assign_client(record, cl);
+                           service->num_metadata, service->num_sortkeys, cl);
 
     mergekey_norm = (xmlChar *) nmem_strdup(se->nmem, (char*) mergekey);
     xmlFree(mergekey);
@@ -974,7 +941,7 @@ struct record *ingest_record(struct client *cl, Z_External *rec,
             int first, last;
 
             type = xmlGetProp(n, (xmlChar *) "type");
-            value = xmlNodeListGetString(xdoc, n->children, 0);
+            value = xmlNodeListGetString(xdoc, n->children, 1);
 
             if (!type || !value)
                 continue;