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