source: trunk/gsdl/src/colservr/mgq.h@ 367

Last change on this file since 367 was 334, checked in by rjmcnab, 25 years ago

Changes for better reporting of number documents which match a query. Changes
should still work as before with older versions of mg.

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.8 KB
Line 
1/**********************************************************************
2 *
3 * mgq.h --
4 * Copyright (C) 1999 The New Zealand Digital Library Project
5 *
6 * PUT COPYRIGHT NOTICE HERE
7 *
8 * $Id: mgq.h 334 1999-07-01 09:29:21Z rjmcnab $
9 *
10 *********************************************************************/
11
12
13#ifndef MGQ_H
14#define MGQ_H
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20
21enum result_kinds {
22 result_docs, /* Return the documents found in last search */
23 result_docnums, /* Return document id numbers and weights */
24 result_termfreqs, /* Return terms and frequencies */
25 result_terms /* Return matching query terms */
26};
27
28int mgq_ask(char *line);
29int mgq_results(enum result_kinds kind, int skip, int howmany,
30 int (*sender)(char *, int, int, float, void *), void *ptr);
31int mgq_numdocs(void);
32int mgq_numterms(void);
33
34/* get all the terms that match wordstem using the current stemmer and */
35/* stemming method. The callback is the same style used by mgq_results */
36int mgq_equivterms (unsigned char *wordstem, int (*sender)(char *, int, int, float, void *),
37 void *ptr);
38
39/* gets the total number of documents retrieved. If this is not available */
40/* it will set total_retrieved to 0 (even when it obviously isn't) */
41int mgq_docsretrieved (int *total_retrieved, int *is_approx);
42
43/* use mgq_getmaxstemlen to determine the length of the word stems to pass */
44/* to mgq_stemword */
45int mgq_getmaxstemlen ();
46
47/* note: the stemming method and the stemmer come from the last query */
48/* "word" should be at least maxstemlen+1 long and it is a string that */
49/* starts with the string length */
50void mgq_stemword (unsigned char *word);
51
52
53int is_dbcache_full (void);
54int load_database (char *collection, char *mgdir, char *gensuffix, char *textsuffix);
55int load_text_database (char *collection);
56void close_all_databases (void);
57
58
59#ifdef __cplusplus
60}
61#endif
62
63
64#endif
Note: See TracBrowser for help on using the repository browser.