Config file 'base' read by default by both indexer and server.
[idzebra-moved-to-github.git] / index / zserver.h
1 /*
2  * Copyright (C) 1994-1995, Index Data I/S 
3  * All rights reserved.
4  * Sebastian Hammer, Adam Dickmeiss
5  *
6  * $Log: zserver.h,v $
7  * Revision 1.15  1995-11-21 15:29:13  adam
8  * Config file 'base' read by default by both indexer and server.
9  *
10  * Revision 1.14  1995/11/16  17:00:57  adam
11  * Better logging of rpn query.
12  *
13  * Revision 1.13  1995/11/16  15:34:56  adam
14  * Uses new record management system in both indexer and server.
15  *
16  * Revision 1.12  1995/10/27  14:00:12  adam
17  * Implemented detection of database availability.
18  *
19  * Revision 1.11  1995/10/17  18:02:12  adam
20  * New feature: databases. Implemented as prefix to words in dictionary.
21  *
22  * Revision 1.10  1995/10/09  16:18:38  adam
23  * Function dict_lookup_grep got extra client data parameter.
24  *
25  * Revision 1.9  1995/10/06  14:38:01  adam
26  * New result set method: r_score.
27  * Local no (sysno) and score is transferred to retrieveCtrl.
28  *
29  * Revision 1.8  1995/10/06  13:52:06  adam
30  * Bug fixes. Handler may abort further scanning.
31  *
32  * Revision 1.7  1995/10/06  10:43:57  adam
33  * Scan added. 'occurrences' in scan entries not set yet.
34  *
35  * Revision 1.6  1995/09/28  09:19:48  adam
36  * xfree/xmalloc used everywhere.
37  * Extract/retrieve method seems to work for text records.
38  *
39  * Revision 1.5  1995/09/27  16:17:32  adam
40  * More work on retrieve.
41  *
42  * Revision 1.4  1995/09/14  11:53:28  adam
43  * First work on regular expressions/truncations.
44  *
45  * Revision 1.3  1995/09/08  08:53:23  adam
46  * Record buffer maintained in server_info.
47  *
48  * Revision 1.2  1995/09/06  16:11:19  adam
49  * Option: only one word key per file.
50  *
51  * Revision 1.1  1995/09/05  15:28:40  adam
52  * More work on search engine.
53  *
54  */
55
56 #include <backend.h>
57 #include <rset.h>
58
59 #include "index.h"
60 #include "recindex.h"
61
62 typedef struct {
63     int sysno;
64     int score;
65 } ZServerSetSysno;
66
67 typedef struct ZServerSet_ {
68     char *name;
69     RSET rset;
70     int size;
71     struct ZServerSet_ *next;
72 } ZServerSet;
73    
74 typedef struct {
75     ZServerSet *sets;
76     Dict wordDict;
77     ISAM wordIsam;
78     Records records;
79     int errCode;
80     char *errString;
81     ODR odr;
82 } ZServerInfo;
83
84 int rpn_search (ZServerInfo *zi, 
85                 Z_RPNQuery *rpn, int num_bases, char **basenames, 
86                 const char *setname, int *hits);
87
88 int rpn_scan (ZServerInfo *zi, Z_AttributesPlusTerm *zapt,
89               int num_bases, char **basenames,
90               int *position, int *num_entries, struct scan_entry **list,
91               int *status);
92
93 ZServerSet *resultSetAdd (ZServerInfo *zi, const char *name,
94                           int ov, RSET rset);
95 ZServerSet *resultSetGet (ZServerInfo *zi, const char *name);
96 ZServerSetSysno *resultSetSysnoGet (ZServerInfo *zi, const char *name,
97                                     int num, int *positions);
98 void resultSetSysnoDel (ZServerInfo *zi, ZServerSetSysno *records, int num);
99 void zlog_rpn (Z_RPNQuery *rpn);