2 * Copyright (C) 1994-1995, Index Data I/S
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.17 1995-11-21 15:01:16 adam
8 * New general match criteria implemented.
9 * New feature: document groups.
11 * Revision 1.16 1995/11/20 11:56:27 adam
12 * Work on new traversal.
14 * Revision 1.15 1995/11/01 16:25:51 quinn
15 * *** empty log message ***
17 * Revision 1.14 1995/10/17 18:02:09 adam
18 * New feature: databases. Implemented as prefix to words in dictionary.
20 * Revision 1.13 1995/10/10 12:24:39 adam
21 * Temporary sort files are compressed.
23 * Revision 1.12 1995/10/04 16:57:20 adam
24 * Key input and merge sort in one pass.
26 * Revision 1.11 1995/09/29 14:01:45 adam
29 * Revision 1.10 1995/09/28 14:22:57 adam
30 * Sort uses smaller temporary files.
32 * Revision 1.9 1995/09/14 07:48:24 adam
33 * Record control management.
35 * Revision 1.8 1995/09/06 16:11:18 adam
36 * Option: only one word key per file.
38 * Revision 1.7 1995/09/05 15:28:39 adam
39 * More work on search engine.
41 * Revision 1.6 1995/09/04 12:33:43 adam
42 * Various cleanup. YAZ util used instead.
44 * Revision 1.5 1995/09/04 09:10:39 adam
45 * More work on index add/del/update.
46 * Merge sort implemented.
47 * Initial work on z39 server.
49 * Revision 1.4 1995/09/01 14:06:36 adam
50 * Split of work into more files.
52 * Revision 1.3 1995/09/01 10:57:07 adam
55 * Revision 1.2 1995/09/01 10:30:24 adam
56 * More work on indexing. Not working yet.
58 * Revision 1.1 1995/08/31 14:50:24 adam
59 * New simple file index tool.
71 size_t mem_max = 4*1024*1024;
72 extern char *data1_tabpath;
74 int main (int argc, char **argv)
79 char *configName = NULL;
81 int key_open_flag = 0;
83 struct recordGroup rGroup;
85 rGroup.groupName = NULL;
86 rGroup.databaseName = NULL;
92 fprintf (stderr, "index [-v log] [-m meg] [-c config] [-d base]"
93 " [-g group] cmd1 dir1 cmd2 dir2 ...\n");
96 while ((ret = options ("c:g:v:m:d:", argv, argc, &arg)) != -2)
100 if(cmd == 0) /* command */
102 if (!strcmp (arg, "add"))
106 else if (!strcmp (arg, "del"))
110 else if (!strcmp (arg, "update"))
116 logf (LOG_FATAL, "Unknown command: %s", arg);
122 if (!common_resource)
124 common_resource = res_open (configName ?
125 configName : "base");
126 if (!common_resource)
128 logf (LOG_FATAL, "Cannot open resource `%s'",
132 data1_tabpath = res_get (common_resource, "data1_tabpath");
133 assert (data1_tabpath);
142 repositoryUpdate (&rGroup);
144 repositoryExtract (&rGroup);
147 logf (LOG_FATAL, "Not implemented yet.");
155 log_init (log_mask_str(arg), prog, NULL);
159 mem_max = 1024*1024*atoi(arg);
163 rGroup.databaseName = arg;
167 rGroup.groupName = arg;
173 logf (LOG_FATAL, "Unknown option '-%s'", arg);
179 nsections = key_close ();
182 logf (LOG_LOG, "Input");
183 key_input (FNAME_WORD_DICT, FNAME_WORD_ISAM, nsections, 60);