New feature: databases. Implemented as prefix to words in dictionary.
[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.11  1995-10-17 18:02:12  adam
8  * New feature: databases. Implemented as prefix to words in dictionary.
9  *
10  * Revision 1.10  1995/10/09  16:18:38  adam
11  * Function dict_lookup_grep got extra client data parameter.
12  *
13  * Revision 1.9  1995/10/06  14:38:01  adam
14  * New result set method: r_score.
15  * Local no (sysno) and score is transferred to retrieveCtrl.
16  *
17  * Revision 1.8  1995/10/06  13:52:06  adam
18  * Bug fixes. Handler may abort further scanning.
19  *
20  * Revision 1.7  1995/10/06  10:43:57  adam
21  * Scan added. 'occurrences' in scan entries not set yet.
22  *
23  * Revision 1.6  1995/09/28  09:19:48  adam
24  * xfree/xmalloc used everywhere.
25  * Extract/retrieve method seems to work for text records.
26  *
27  * Revision 1.5  1995/09/27  16:17:32  adam
28  * More work on retrieve.
29  *
30  * Revision 1.4  1995/09/14  11:53:28  adam
31  * First work on regular expressions/truncations.
32  *
33  * Revision 1.3  1995/09/08  08:53:23  adam
34  * Record buffer maintained in server_info.
35  *
36  * Revision 1.2  1995/09/06  16:11:19  adam
37  * Option: only one word key per file.
38  *
39  * Revision 1.1  1995/09/05  15:28:40  adam
40  * More work on search engine.
41  *
42  */
43
44 #include "index.h"
45 #include <backend.h>
46 #include <rset.h>
47
48 typedef struct {
49     int sysno;
50     int score;
51 } ZServerSetSysno;
52
53 typedef struct ZServerSet_ {
54     char *name;
55     RSET rset;
56     int size;
57     struct ZServerSet_ *next;
58 } ZServerSet;
59    
60 typedef struct {
61     ZServerSet *sets;
62     Dict wordDict;
63     ISAM wordIsam;
64     Dict fileDict;
65     int sys_idx_fd;
66     int errCode;
67     char *errString;
68     ODR odr;
69 } ZServerInfo;
70
71 int rpn_search (ZServerInfo *zi, 
72                 Z_RPNQuery *rpn, int num_bases, char **basenames, 
73                 const char *setname, int *hits);
74
75 int rpn_scan (ZServerInfo *zi, ODR odr, Z_AttributesPlusTerm *zapt,
76               int num_bases, char **basenames,
77               int *position, int *num_entries, struct scan_entry **list,
78               int *status);
79
80 ZServerSet *resultSetAdd (ZServerInfo *zi, const char *name,
81                           int ov, RSET rset);
82 ZServerSet *resultSetGet (ZServerInfo *zi, const char *name);
83 ZServerSetSysno *resultSetSysnoGet (ZServerInfo *zi, const char *name,
84                                     int num, int *positions);
85 void resultSetSysnoDel (ZServerInfo *zi, ZServerSetSysno *records, int num);