X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fsession.h;h=76786f4042d22ad00c2b770199c73ac90b13d124;hb=efe1343048be89213f3a9933e6b9fbbd481f3d61;hp=0b05afc81b73478d95e01ff778569bf4a97a02f9;hpb=fe7206771852a37728cbdd4e1b76e2eb482980e7;p=pazpar2-moved-to-github.git diff --git a/src/session.h b/src/session.h index 0b05afc..76786f4 100644 --- a/src/session.h +++ b/src/session.h @@ -1,5 +1,5 @@ /* This file is part of Pazpar2. - Copyright (C) 2006-2013 Index Data + Copyright (C) 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 @@ -26,9 +26,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include #include "facet_limit.h" -#include "termlists.h" +#include "relevance.h" #include "reclists.h" -#include "http.h" struct record; struct client; @@ -54,15 +53,6 @@ enum pazpar2_error_code { PAZPAR2_LAST_ERROR }; -// Represents a database -struct database { - char *id; - int num_settings; - struct setting **settings; - struct database *next; -}; - - // Represents a database as viewed from one session, possibly with settings overriden // for that session struct session_database @@ -111,6 +101,8 @@ struct session { struct named_termlist termlists[SESSION_MAX_TERMLISTS]; struct relevance *relevance; struct reclist *reclist; + char *mergekey; + char *rank; struct session_watchentry watchlist[SESSION_WATCH_MAX + 1]; int total_records; int total_merged; @@ -121,6 +113,7 @@ struct session { unsigned session_id; int settings_modified; facet_limits_t facet_limits; + int clients_starting; struct reclist_sortparms *sorted_results; }; @@ -155,18 +148,23 @@ struct hitsbytarget { struct hitsbytarget *get_hitsbytarget(struct session *s, int *count, NMEM nmem); struct session *new_session(NMEM nmem, struct conf_service *service, unsigned session_id); +int sessions_count(void); 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, struct reclist_sortparms *sp); +void session_sort(struct session *se, struct reclist_sortparms *sp, + const char *mergekey, const char *rank); 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, - struct reclist_sortparms *sort_parm); + const char **addinfo2, + struct reclist_sortparms *sort_parm, + const char *mergekey, + const char *rank); struct record_cluster **show_range_start(struct session *s, struct reclist_sortparms *sp, int start, @@ -185,10 +183,13 @@ void show_single_stop(struct session *s, struct record_cluster *rec); 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); -void session_apply_setting(struct session *se, char *dbname, char *setting, char *value); +void session_apply_setting(struct session *se, const char *dbname, + const char *setting, const char *value); const char *session_setting_oneval(struct session_database *db, int offset); int ingest_record(struct client *cl, const char *rec, int record_no, NMEM nmem); +int ingest_xml_record(struct client *cl, xmlDoc *xdoc, + int record_no, NMEM nmem, int cached_copy); void session_alert_watch(struct session *s, int what); void add_facet(struct session *s, const char *type, const char *value, int count);