Index statistics working again
[idzebra-moved-to-github.git] / index / zebraapi.h
index d5168ac..1b822b3 100644 (file)
@@ -1,48 +1,35 @@
 /*
- * Copyright (C) 1994-1998, Index Data
+ * Copyright (C) 1994-2002, Index Data
  * All rights reserved.
  * Sebastian Hammer, Adam Dickmeiss
  *
- * $Log: zebraapi.h,v $
- * Revision 1.10  2000-03-15 15:00:31  adam
- * First work on threaded version.
- *
- * Revision 1.9  2000/02/24 12:31:17  adam
- * Added zebra_string_norm.
- *
- * Revision 1.8  1999/11/30 13:48:03  adam
- * Improved installation. Updated for inclusion of YAZ header files.
- *
- * Revision 1.7  1999/11/04 15:00:45  adam
- * Implemented delete result set(s).
- *
- * Revision 1.6  1999/02/17 11:29:57  adam
- * Fixed in record_fetch. Minor updates to API.
- *
- * Revision 1.5  1998/09/22 10:48:19  adam
- * Minor changes in search API.
- *
- * Revision 1.4  1998/09/02 13:53:18  adam
- * Extra parameter decode added to search routines to implement
- * persistent queries.
- *
- * Revision 1.3  1998/06/22 11:36:48  adam
- * Added authentication check facility to zebra.
- *
- * Revision 1.2  1998/06/13 00:14:09  adam
- * Minor changes.
- *
- * Revision 1.1  1998/06/12 12:22:13  adam
- * Work on Zebra API.
- *
+ * $Id: zebraapi.h,v 1.16 2002-04-26 08:44:47 adam Exp $
  */
 
+#ifndef ZEBRAAPI_H
+#define ZEBRAAPI_H
+
 #include <yaz/odr.h>
 #include <yaz/oid.h>
 #include <yaz/proto.h>
+#include <zebraver.h>
 
 YAZ_BEGIN_CDECL
 
+struct recordGroup {
+    char         *groupName;
+    char         *databaseName;
+    char         *path;
+    char         *recordId;
+    char         *recordType;
+    int          flagStoreData;
+    int          flagStoreKeys;
+    int          flagRw;
+    int          fileVerboseLimit;
+    int          databaseNamePath;
+    int          explainDatabase;
+};
+
 /* Retrieval Record Descriptor */
 typedef struct {
     int errCode;         /* non-zero if error when fetching this */
@@ -68,8 +55,8 @@ YAZ_EXPORT ZebraHandle zebra_open (ZebraService zs);
 
 /* Search using RPN-Query */
 YAZ_EXPORT void zebra_search_rpn (ZebraHandle zh, ODR input, ODR output,
-                       Z_RPNQuery *query, int num_bases, char **basenames, 
-                      const char *setname);
+                                  Z_RPNQuery *query,
+                                  const char *setname, int *hits);
 
 /* Retrieve record(s) */
 YAZ_EXPORT void zebra_records_retrieve (ZebraHandle zh, ODR stream,
@@ -81,7 +68,6 @@ YAZ_EXPORT void zebra_records_retrieve (ZebraHandle zh, ODR stream,
 YAZ_EXPORT void zebra_scan (ZebraHandle zh, ODR stream,
                            Z_AttributesPlusTerm *zapt,
                            oid_value attributeset,
-                           int num_bases, char **basenames,
                            int *position, int *num_entries,
                            ZebraScanEntry **list,
                            int *is_partial);
@@ -102,11 +88,8 @@ YAZ_EXPORT const char *zebra_errString (ZebraHandle zh);
 /* extra information associated with error */
 YAZ_EXPORT char *zebra_errAdd (ZebraHandle zh);
 
-/* number of hits (after search) */
-YAZ_EXPORT int zebra_hits (ZebraHandle zh);
-
 /* do authentication */
-YAZ_EXPORT int zebra_auth (ZebraService zh, const char *user, const char *pass);
+YAZ_EXPORT int zebra_auth (ZebraHandle zh, const char *user, const char *pass);
 
 /* Character normalisation on specific register .
    This routine is subject to change - do not use. */
@@ -119,4 +102,58 @@ YAZ_EXPORT void zebra_admin_create (ZebraHandle zh, const char *db);
 YAZ_EXPORT ZebraService zebra_start (const char *configName);
 YAZ_EXPORT void zebra_stop (ZebraService zs);
 
+YAZ_EXPORT void zebra_admin_shutdown (ZebraHandle zh);
+YAZ_EXPORT void zebra_admin_start (ZebraHandle zh);
+
+YAZ_EXPORT void zebra_shutdown (ZebraService zs);
+
+YAZ_EXPORT void zebra_admin_import_begin (ZebraHandle zh, const char *database);
+
+YAZ_EXPORT void zebra_admin_import_segment (ZebraHandle zh,
+                                           Z_Segment *segment);
+
+void zebra_admin_import_end (ZebraHandle zh);
+
+void zebra_begin_trans (ZebraHandle zh);
+void zebra_end_trans (ZebraHandle zh);
+
+int zebra_commit (ZebraHandle zh);
+
+int zebra_init (ZebraHandle zh);
+int zebra_compact (ZebraHandle zh);
+void zebra_repository_update (ZebraHandle zh);
+void zebra_repository_delete (ZebraHandle zh);
+void zebra_repository_show (ZebraHandle zh);
+int zebra_record_insert (ZebraHandle zh, const char *buf, int len);
+
+YAZ_EXPORT void zebra_set_group (ZebraHandle zh, struct recordGroup *rg);
+
+YAZ_EXPORT void zebra_result (ZebraHandle zh, int *code, char **addinfo);
+
+YAZ_EXPORT const char *zebra_resultSetTerms (ZebraHandle zh,
+                                             const char *setname, 
+                                             int no, int *count, int *no_max);
+
+YAZ_EXPORT void zebra_sort (ZebraHandle zh, ODR stream,
+                            int num_input_setnames,
+                            const char **input_setnames,
+                            const char *output_setname,
+                            Z_SortKeySpecList *sort_sequence,
+                            int *sort_status);
+
+
+YAZ_EXPORT
+int zebra_select_databases (ZebraHandle zh, int num_bases, 
+                            const char **basenames);
+
+YAZ_EXPORT
+int zebra_select_database (ZebraHandle zh, const char *basename);
+
+YAZ_EXPORT
+void zebra_shadow_enable (ZebraHandle zh, int value);
+
+YAZ_EXPORT
+void zebra_register_statistics (ZebraHandle zh);
+
 YAZ_END_CDECL                                
+#endif