First ICU chain integration in relevance ranking of pazpar2.
[pazpar2-moved-to-github.git] / src / logic.c
index f54b303..261febc 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: logic.c,v 1.29 2007-05-16 17:16:21 quinn Exp $
+/* $Id: logic.c,v 1.31 2007-05-23 14:44:18 marc Exp $
    Copyright (c) 2006-2007, Index Data.
 
 This file is part of Pazpar2.
@@ -493,7 +493,17 @@ static void session_init_databases_fun(void *context, struct database *db)
 
     new->database = db;
     new->yaz_marc = 0;
-    new->pct = pp2_charset_create();
+
+#ifdef HAVE_ICU
+    if (global_parameters.server && global_parameters.server->icu_chn)
+            new->pct
+                = pp2_charset_create(global_parameters.server->icu_chn);
+        else
+            new->pct = pp2_charset_create(0);
+#else // HAVE_ICU
+    new->pct = pp2_charset_create(0);
+#endif // HAVE_ICU
+
     new->map = 0;
     new->settings 
         = nmem_malloc(se->session_nmem, sizeof(struct settings *) * num);
@@ -566,11 +576,12 @@ void session_apply_setting(struct session *se, char *dbname, char *setting,
         yaz_log(YLOG_WARN, "Unknown setting %s", setting);
         return;
     }
-    if (offset == PZ_ID)
+    // Jakub: This breaks the filter setting.
+    /*if (offset == PZ_ID)
     {
         yaz_log(YLOG_WARN, "No need to set pz:id setting. Ignoring");
         return;
-    }
+    }*/
     new->precedence = 0;
     new->target = dbname;
     new->name = setting;