PAZPAR2_RECORD_FAIL,
PAZPAR2_NOT_IMPLEMENTED,
PAZPAR2_NO_SERVICE,
+ PAZPAR2_ALREADY_BLOCKED,
PAZPAR2_LAST_ERROR
};
-struct host;
-// Represents a (virtual) database on a host
+// Represents a database
struct database {
- struct host *host;
- char *url;
- char **databases;
- int errors;
- struct zr_explain *explain;
+ char *id;
int num_settings;
struct setting **settings;
struct database *next;
#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
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)
int num_termlists;
struct relevance *relevance;
struct reclist *reclist;
struct session_watchentry watchlist[SESSION_WATCH_MAX + 1];
- Odr_int total_hits;
int total_records;
int total_merged;
int number_of_warnings_unknown_elements;
normalize_cache_t normalize_cache;
YAZ_MUTEX session_mutex;
unsigned session_id;
+ int settings_modified;
+ struct session_sorted_results *sorted_results;
};
struct statistics {
};
struct hitsbytarget {
- char *id;
+ const char *id;
const char *name;
Odr_int hits;
int diagnostic;
+ const char *addinfo;
int records;
const char *state;
int connected;
char *settings_xml;
+ char *suggestions_xml;
};
-struct hitsbytarget *hitsbytarget(struct session *s, int *count, NMEM nmem);
+struct hitsbytarget *get_hitsbytarget(struct session *s, int *count, NMEM nmem);
struct session *new_session(NMEM nmem, struct conf_service *service,
unsigned session_id);
-void destroy_session(struct session *s);
+void session_destroy(struct session *s);
void session_init_databases(struct session *s);
-int load_targets(struct session *s, const char *fn);
void statistics(struct session *s, struct statistics *stat);
-enum pazpar2_error_code search(struct session *s, const char *query,
- const char *startrecs, const char *maxrecs,
- const char *filter, const char *limit,
- const char **addinfo);
+
+void session_sort(struct session *se, const char *field, int increasing);
+
+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 record_cluster **show_range_start(struct session *s,
struct reclist_sortparms *sp,
int start,
void session_apply_setting(struct session *se, char *dbname, char *setting, char *value);
const char *session_setting_oneval(struct session_database *db, int offset);
-int host_getaddrinfo(struct host *host, iochan_man_t iochan_man);
-
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 session_log(struct session *s, int level, const char *fmt, ...)
#ifdef __GNUC__
__attribute__ ((format (printf, 3, 4)))
;
#endif
+struct session_sorted_results {
+ const char *field;
+ int increasing;
+ struct session_sorted_results *next;
+};
+
/*
* Local variables:
* c-basic-offset: 4