/* This file is part of Pazpar2.
- Copyright (C) 2006-2012 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
#include <yaz/ccl.h>
#include <yaz/yaz-ccl.h>
-#include "termlists.h"
+#include "facet_limit.h"
+#include "relevance.h"
#include "reclists.h"
-#include "http.h"
struct record;
struct client;
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
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;
YAZ_MUTEX session_mutex;
unsigned session_id;
int settings_modified;
- struct session_sorted_results *sorted_results;
+ facet_limits_t facet_limits;
+ struct reclist_sortparms *sorted_results;
};
struct statistics {
Odr_int hits;
Odr_int approximation;
int diagnostic;
+ const char *message;
const char *addinfo;
int records;
int filtered;
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, const char *field, int increasing, int clear_set);
+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,
- int *num, int *total, Odr_int *sumhits, Odr_int *approximation);
+ int *num, int *total,
+ Odr_int *sumhits,
+ Odr_int *approximation,
+ void (*ready)(void *data),
+ struct http_channel *chan);
+int session_fetch_more(struct session *s);
void show_range_stop(struct session *s, struct record_cluster **recs);
struct record_cluster *show_single_start(struct session *s, const char *id,
void session_alert_watch(struct session *s, int what);
void add_facet(struct session *s, const char *type, const char *value, int count);
+int session_check_cluster_limit(struct session *se, struct record_cluster *rec);
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, ...)
;
#endif
-struct session_sorted_results {
- const char *field;
- int increasing;
- int position;
- struct session_sorted_results *next;
-};
-
/*
* Local variables:
* c-basic-offset: 4