Paging support, small bug fixes
[pazpar2-moved-to-github.git] / pazpar2.h
index 0a737ac..790fd24 100644 (file)
--- a/pazpar2.h
+++ b/pazpar2.h
@@ -1,13 +1,20 @@
 #ifndef PAZPAR2_H
 #define PAZPAR2_H
 
+struct record;
+
 #include <yaz/pquery.h>
+#include "termlists.h"
+#include "relevance.h"
 
 struct record {
     struct target *target;
     int target_offset;
     char *buf;
     char *merge_key;
+    char *title;
+    int relevance;
+    int *term_frequency_vec;
     struct record *next_cluster;
 };
 
@@ -18,10 +25,11 @@ struct session {
     char query[1024];
     NMEM nmem;
     WRBUF wrbuf;
-    struct record **recheap;
-    int recheap_size;
-    int recheap_max;
-    int recheap_scratch;
+    struct termlist *termlist;
+    struct relevance *relevance;
+    struct reclist *reclist;
+    int total_hits;
+    int total_records;
     yaz_marc_t yaz_marc;
 };
 
@@ -35,6 +43,8 @@ struct statistics {
     int num_idle;
     int num_failed;
     int num_error;
+    int num_hits;
+    int num_records;
 };
 
 struct hitsbytarget {
@@ -50,8 +60,9 @@ struct session *new_session();
 void session_destroy(struct session *s);
 int load_targets(struct session *s, const char *fn);
 void statistics(struct session *s, struct statistics *stat);
-void search(struct session *s, char *query);
-struct record **show(struct session *s, int start, int *num);
+char *search(struct session *s, char *query);
+struct record **show(struct session *s, int start, int *num, int *total, int *sumhits);
+struct termlist_score **termlist(struct session *s, int *num);
 
 #endif