// Represents a database
struct database {
- char *url;
+ 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_BYTARGET 3
+#define SESSION_WATCH_MAX 3
#define SESSION_MAX_TERMLISTS 10
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;
+ 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 *state;
int connected;
char *settings_xml;
+ char *suggestions_xml;
};
struct hitsbytarget *get_hitsbytarget(struct session *s, int *count, NMEM nmem);
unsigned session_id);
void destroy_session(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,