/* WIDE AREA INFORMATION SERVER SOFTWARE	
   No guarantees or restrictions.  See the readme file for the full standard 
   disclaimer.
   3.26.90	Brewster Kahle, brewster@think.com
*/

/* header file for irsearch.c */

#ifndef _H_search_
#define _H_search_

#include "cdialect.h"
#include "irfiles.h"
#include "cutil.h"
#include "futil.h"
#include "dochash.h"
#include "irhash.h"



/* the default database to use if none is specified */
#define	INFO_DATABASE_NAME	"INFO"
#define MAX_NORMAL_SCORE 1000

/* The locations of the TechInfo web index files */
#define TI_INDEX_NAME "techinfo"

/* changed afs pointer to local disk space - 7/3/94 */
/* #define TI_INDEX_DIR  "/afs/net/project/wais/autumn/techinfo/indexes" */
#define TI_INDEX_DIR  "/u1/wais"

extern char *server_name;
extern long tcp_port;


typedef struct hit {
	long 	weight;
	long 	document_id;
	long 	best_character; /* this is the offset into the 
				    document of the character at	
				    the start of the best section */
	long 	best_line; /* similar to best_character but for lines */
	database *db;
} hit;	

typedef struct search {
	database*		db;	
	double*			document_score_array;
	unsigned long		num_best_hits;
	hit*			best_hits;
} search;

/* exported functions */
#ifdef __cplusplus
/* declare these as C style functions */
extern "C"
	{
#endif /* def __cplusplus */

hit *run_search 
  _AP((char *DatabaseName, char *index_directory, 
       char *keywords, long MaxDocumentsRetrieved));

#ifdef __cplusplus
	}
#endif /* def __cplusplus */



#endif
