"pz:facetmap:",
"pz:limitmap:",
"pz:url",
+ "pz:sortmap:",
0
};
// This is called from grep_databases -- adds/overrides setting for a target
// This is also where the rules for precedence of settings are implemented
-static void update_database(void *context, struct database *db)
+static void update_database_fun(void *context, struct database *db)
{
struct setting *set = ((struct update_database_context *)
context)->set;
int offset;
// Is this the right database?
- if (!match_zurl(db->url, set->target))
+ if (!match_zurl(db->id, set->target))
return;
offset = settings_create_offset(service, set->name);
struct update_database_context context;
context.set = set;
context.service = service;
- predef_grep_databases(&context, service, update_database);
+ predef_grep_databases(&context, service, update_database_fun);
}
// This simply copies the 'hard' (application-specific) settings
static void prepare_target_dictionary(void *client_data, struct setting *set)
{
struct conf_service *service = (struct conf_service *) client_data;
- struct setting_dictionary *dictionary = service->dictionary;
-
- int i;
- char *p;
// If target address is not wildcard, add the database
if (*set->target && !zurl_wildcard(set->target))
- find_database(set->target, service);
-
- // Determine if we already have a dictionary entry
- if (!strncmp(set->name, "pz:", 3) && (p = strchr(set->name + 3, ':')))
- *(p + 1) = '\0';
- for (i = 0; i < dictionary->num; i++)
- if (!strcmp(dictionary->dict[i], set->name))
- return;
- yaz_log(YLOG_WARN, "Setting '%s' not configured as metadata", set->name);
+ create_database_for_service(set->target, service);
}
void init_settings(struct conf_service *service)