service->z3950_session_timeout = 180;
service->z3950_operation_timeout = 30;
service->rank_cluster = 1;
+ service->rank_debug = 0;
+ service->rank_follow = 0;
+ service->rank_lead = 0.0;
+ service->rank_length = 2;
service->charsets = 0;
else if (!strcmp((const char *) n->name, "rank"))
{
char *rank_cluster = (char *) xmlGetProp(n, (xmlChar *) "cluster");
-
- if (rank_cluster && !strcmp(rank_cluster, "yes"))
- service->rank_cluster = 1;
- else if (rank_cluster && !strcmp(rank_cluster, "no"))
- service->rank_cluster = 0;
- else
+ char *rank_debug = (char *) xmlGetProp(n, (xmlChar *) "debug");
+ char *rank_follow = (char *) xmlGetProp(n, (xmlChar *) "follow");
+ char *rank_lead = (char *) xmlGetProp(n, (xmlChar *) "lead");
+ char *rank_length= (char *) xmlGetProp(n, (xmlChar *) "length");
+ if (rank_cluster)
{
- yaz_log(YLOG_FATAL, "service: rank@cluster boolean");
- return 0;
+ if (!strcmp(rank_cluster, "yes"))
+ service->rank_cluster = 1;
+ else if (!strcmp(rank_cluster, "no"))
+ service->rank_cluster = 0;
+ else
+ {
+ yaz_log(YLOG_FATAL, "service: rank@cluster boolean");
+ return 0;
+ }
+ }
+ if (rank_debug)
+ {
+ if (!strcmp(rank_debug, "yes"))
+ service->rank_debug = 1;
+ else if (!strcmp(rank_debug, "no"))
+ service->rank_debug = 0;
+ else
+ {
+ yaz_log(YLOG_FATAL, "service: rank@debug boolean");
+ return 0;
+ }
+ }
+ if (rank_follow)
+ {
+ service->rank_follow = atoi(rank_follow);
+ }
+ if (rank_lead)
+ {
+ service->rank_lead = atof(rank_lead);
+ }
+ if (rank_length)
+ {
+ if (!strcmp(rank_length, "linear"))
+ service->rank_length = 2;
+ else if (!strcmp(rank_length, "log"))
+ service->rank_length = 1;
+ else if (!strcmp(rank_length, "none"))
+ service->rank_length = 0;
+ else
+ {
+ yaz_log(YLOG_FATAL, "service: rank@length linear|log|none");
+ return 0;
+ }
}
xmlFree(rank_cluster);
+ xmlFree(rank_debug);
+ xmlFree(rank_follow);
+ xmlFree(rank_lead);
+ xmlFree(rank_length);
}
else if (!strcmp((const char *) n->name, "sort-default"))
{
if (default_sort && strcmp(default_sort, "")) {
service->default_sort = nmem_strdup(service->nmem, default_sort);
- yaz_log(YLOG_LOG, "service %d: default sort order configured to: %s", service_id, default_sort);
+ yaz_log(YLOG_LOG, "service %s: default sort order configured to: %s",
+ service_id ? service_id : "unnamed", default_sort);
}
else
{