Update snippets handling for new store keys structure. Also omit
[idzebra-moved-to-github.git] / index / zebraapi.c
index 8b393ec..40aa1cc 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: zebraapi.c,v 1.181 2005-08-17 21:29:44 adam Exp $
+/* $Id: zebraapi.c,v 1.184 2005-08-22 09:04:18 adam Exp $
    Copyright (C) 1995-2005
    Index Data ApS
 
@@ -126,6 +126,7 @@ ZebraHandle zebra_open (ZebraService zs)
     zh->lock_shadow = 0;
 
     zh->shadow_enable = 1;
+    zh->m_staticrank = 0;
 
     default_encoding = res_get_def(zs->global_res, "encoding", "ISO-8859-1");
 
@@ -329,8 +330,9 @@ struct zebra_register *zebra_register_open (ZebraService zs, const char *name,
     reg->key_file_no = 0;
     reg->ptr_i = 0;
     
-    zebraRankInstall (reg, rank1_class);
-    zebraRankInstall (reg, rankzv_class);
+    zebraRankInstall (reg, rank_1_class);
+    zebraRankInstall (reg, rank_zv_class);
+    zebraRankInstall (reg, rank_static_class);
 
     recordCompression = res_get_def (res, "recordCompression", "none");
     if (!strcmp (recordCompression, "none"))
@@ -699,6 +701,13 @@ static void zebra_select_register (ZebraHandle zh, const char *new_reg)
        if (res_get_int(zh->res, "estimatehits", &approx) == ZEBRA_OK)
            zebra_set_approx_limit(zh, approx);
     }
+    if (zh->res)
+    {
+       if (res_get_int(zh->res, "staticrank", &zh->m_staticrank) == ZEBRA_OK)
+           yaz_log(YLOG_LOG, "static rank set and is %d", zh->m_staticrank);
+       else
+           yaz_log(YLOG_LOG, "static rank unset");
+    }
 }
 
 void map_basenames_func (void *vp, const char *name, const char *value)
@@ -1230,13 +1239,13 @@ ZEBRA_RES zebra_admin_import_segment (ZebraHandle zh, Z_Segment *segment)
                Odr_oct *oct = fragment->u.notExternallyTagged;
                sysno = 0;
                
-               if ( zebra_update_record(zh, 
-                                        0, /* record Type */
-                                        &sysno,
-                                        0, /* match */
-                                        0, /* fname */
-                                        oct->buf, oct->len,
-                                        0) == ZEBRA_FAIL)
+               if (zebra_update_record(zh, 
+                                       0, /* record Type */
+                                       &sysno,
+                                       0, /* match */
+                                       0, /* fname */
+                                       (const char *) oct->buf, oct->len,
+                                       0) == ZEBRA_FAIL)
                    res = ZEBRA_FAIL;
            }
        }