/* This file is part of Pazpar2.
- Copyright (C) 2006-2010 Index Data
+ Copyright (C) 2006-2011 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
#define MAX_CHUNK 15
-inline int max(int a, int b)
-{
- return (a > b) ? a : b;
-}
-
+#define MAX(a,b) ((a)>(b)?(a):(b))
// Note: Some things in this structure will eventually move to configuration
struct parameters global_parameters =
mergekey_norm,
&se->total_merged);
- int use_term_factor = session_setting_oneval(sdb, PZ_TERMLIST_TERM_FACTOR);
+ const char *use_term_factor_str = session_setting_oneval(sdb, PZ_TERMLIST_TERM_FACTOR);
+ int use_term_factor = 1;
+ // HACK: default to use term factor.
int term_factor = 1;
-
+ if (use_term_factor_str && use_term_factor_str[0] != 0)
+ use_term_factor = atoi(use_term_factor_str);
if (use_term_factor) {
int maxrecs = client_get_maxrecs(cl);
int hits = (int) client_get_hits(cl);
- term_factor = max(hits, maxrecs) / max(1, maxrecs);
+ term_factor = MAX(hits, maxrecs) / MAX(1, maxrecs);
assert(term_factor >= 1);
yaz_log(YLOG_DEBUG, "Using term factor %d ", term_factor);
}