X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=src%2Fsession.h;h=45fdbb3a1631b6d89668b316da61f4e3730a1753;hb=d2db0f728572c6abdcd7c3d5ff3d9f59705af208;hp=70b5f74ef27492a431436c578819cd17dad8f662;hpb=f0c036628de8084804056af14c6f89990227bdaf;p=pazpar2-moved-to-github.git diff --git a/src/session.h b/src/session.h index 70b5f74..45fdbb3 100644 --- a/src/session.h +++ b/src/session.h @@ -1,5 +1,5 @@ /* This file is part of Pazpar2. - Copyright (C) 2006-2011 Index Data + Copyright (C) 2006-2012 Index Data Pazpar2 is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -48,6 +48,7 @@ enum pazpar2_error_code { PAZPAR2_RECORD_FAIL, PAZPAR2_NOT_IMPLEMENTED, PAZPAR2_NO_SERVICE, + PAZPAR2_ALREADY_BLOCKED, PAZPAR2_LAST_ERROR }; @@ -75,7 +76,9 @@ struct session_database #define SESSION_WATCH_SHOW 0 #define SESSION_WATCH_RECORD 1 #define SESSION_WATCH_SHOW_PREF 2 -#define SESSION_WATCH_MAX 2 +#define SESSION_WATCH_TERMLIST 3 +#define SESSION_WATCH_BYTARGET 4 +#define SESSION_WATCH_MAX 4 #define SESSION_MAX_TERMLISTS 10 @@ -99,7 +102,7 @@ struct client_list; struct session { struct conf_service *service; /* service in use for this session */ struct session_database *databases; // All databases, settings overriden - struct client_list *clients; // Clients connected for current search + struct client_list *clients_active; // Clients connected for current search struct client_list *clients_cached; // Clients in cache NMEM session_nmem; // Nmem for session-permanent storage NMEM nmem; // Nmem for each operation (i.e. search, result set, etc) @@ -135,8 +138,11 @@ struct hitsbytarget { const char *id; const char *name; Odr_int hits; + Odr_int approximation; int diagnostic; + const char *addinfo; int records; + int filtered; const char *state; int connected; char *settings_xml; @@ -150,26 +156,24 @@ void session_destroy(struct session *s); void session_init_databases(struct session *s); void statistics(struct session *s, struct statistics *stat); -void session_sort(struct session *se, const char *field, int increasing); +void session_sort(struct session *se, const char *field, int increasing, int clear_set); enum pazpar2_error_code session_search(struct session *s, const char *query, const char *startrecs, const char *maxrecs, const char *filter, const char *limit, const char **addinfo, - const char *sort_field, int increasing); + struct reclist_sortparms *sort_parm); struct record_cluster **show_range_start(struct session *s, struct reclist_sortparms *sp, int start, - int *num, int *total, Odr_int *sumhits); + int *num, int *total, Odr_int *sumhits, Odr_int *approximation); void show_range_stop(struct session *s, struct record_cluster **recs); struct record_cluster *show_single_start(struct session *s, const char *id, struct record_cluster **prev_r, struct record_cluster **next_r); void show_single_stop(struct session *s, struct record_cluster *rec); -struct termlist_score **get_termlist_score(struct session *s, - const char *name, int *num); int session_set_watch(struct session *s, int what, session_watchfun fun, void *data, struct http_channel *c); int session_active_clients(struct session *s); int session_is_preferred_clients_ready(struct session *s); @@ -180,8 +184,8 @@ int ingest_record(struct client *cl, const char *rec, int record_no, NMEM nmem); void session_alert_watch(struct session *s, int what); void add_facet(struct session *s, const char *type, const char *value, int count); -void perform_termlist(struct http_channel *c, struct session *se, - const char *name, int num); + +void perform_termlist(struct http_channel *c, struct session *se, const char *name, int num, int version); void session_log(struct session *s, int level, const char *fmt, ...) #ifdef __GNUC__ __attribute__ ((format (printf, 3, 4))) @@ -189,6 +193,13 @@ void session_log(struct session *s, int level, const char *fmt, ...) ; #endif +struct session_sorted_results { + const char *field; + int increasing; + int position; + struct session_sorted_results *next; +}; + /* * Local variables: * c-basic-offset: 4