Update snippets handling for new store keys structure. Also omit
[idzebra-moved-to-github.git] / index / zinfo.c
index fc355db..e13b8c3 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: zinfo.c,v 1.47 2005-08-05 10:40:13 adam Exp $
+/* $Id: zinfo.c,v 1.50 2005-08-26 10:13:31 adam Exp $
    Copyright (C) 1995-2005
    Index Data ApS
 
@@ -373,7 +373,7 @@ ZebraExplainInfo zebraExplain_open (
                 0, 0, 0,  0, 0, 0);
     }
     zdip = &zei->databaseInfo;
-    trec = rec_get (records, 1);      /* get "root" record */
+    trec = rec_get_root(records);      /* get "root" record */
 
     zei->ordinalSU = 1;
     zei->runNumber = 0;
@@ -1309,7 +1309,7 @@ static void zebraExplain_writeTarget (ZebraExplainInfo zei, int key_flush)
        return;
     zei->dirty = 0;
 
-    trec = rec_get (zei->records, 1);
+    trec = rec_get_root(zei->records);
     xfree (trec->info[recInfo_storeData]);
 
     node_tgtinfo = data1_search_tag (zei->dh, zei->data1_target,
@@ -1416,7 +1416,9 @@ int zebraExplain_trav_ord(ZebraExplainInfo zei, void *handle,
 }
                          
 int zebraExplain_lookup_ord (ZebraExplainInfo zei, int ord,
-                            const char **db, int *set, int *use)
+                            int *index_type, 
+                            const char **db,
+                            int *set, int *use)
 {
     struct zebDatabaseInfoB *zdb;
     for (zdb = zei->databaseInfo; zdb; zdb = zdb->next)
@@ -1426,9 +1428,14 @@ int zebraExplain_lookup_ord (ZebraExplainInfo zei, int ord,
            if (zsui->info.which == ZEB_SU_SET_USE && 
                zsui->info.ordinal == ord)
            {
-               *db = zdb->databaseName;
-               *set = zsui->info.u.su.set;
-               *use = zsui->info.u.su.use;
+               if (db)
+                   *db = zdb->databaseName;
+               if (set)
+                   *set = zsui->info.u.su.set;
+               if (use)
+                   *use = zsui->info.u.su.use;
+               if (index_type)
+                   *index_type = zsui->info.index_type;
                return 0;
            }
     }
@@ -1562,6 +1569,7 @@ RecordAttr *rec_init_attr (ZebraExplainInfo zei, Record rec)
     recordAttr->recordSize = 0;
     recordAttr->recordOffset = 0;
     recordAttr->runNumber = zei->runNumber;
+    recordAttr->staticrank = 0;
     return recordAttr;
 }