From 4d9f530309235e8c78d50f82196f135c3127c064 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 14 Sep 2011 13:06:48 +0200 Subject: [PATCH] Rename metadata attribute icu_chain to facetrule This is have the possiblity to override other than just facet normalization per metadata field in the future. --- src/pazpar2_config.c | 10 +++++----- src/pazpar2_config.h | 2 +- src/session.c | 2 +- test/test_icu.cfg | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/pazpar2_config.c b/src/pazpar2_config.c index 8fec8cc..8a7b651 100644 --- a/src/pazpar2_config.c +++ b/src/pazpar2_config.c @@ -71,7 +71,7 @@ static void conf_metadata_assign(NMEM nmem, int rank, int sortkey_offset, enum conf_metadata_mergekey mt, - const char *icu_chain) + const char *facetrule) { assert(nmem && metadata && name); @@ -91,7 +91,7 @@ static void conf_metadata_assign(NMEM nmem, metadata->rank = rank; metadata->sortkey_offset = sortkey_offset; metadata->mergekey = mt; - metadata->icu_chain = nmem_strdup_null(nmem, icu_chain); + metadata->facetrule = nmem_strdup_null(nmem, facetrule); } @@ -157,7 +157,7 @@ static struct conf_metadata* conf_service_add_metadata( int rank, int sortkey_offset, enum conf_metadata_mergekey mt, - const char *icu_chain) + const char *facetrule) { struct conf_metadata * md = 0; @@ -168,7 +168,7 @@ static struct conf_metadata* conf_service_add_metadata( md = service->metadata + field_id; conf_metadata_assign(service->nmem, md, name, type, merge, setting, brief, termlist, rank, sortkey_offset, - mt, icu_chain); + mt, facetrule); return md; } @@ -309,7 +309,7 @@ static int parse_metadata(struct conf_service *service, xmlNode *n, else if (!xmlStrcmp(attr->name, BAD_CAST "mergekey") && attr->children && attr->children->type == XML_TEXT_NODE) xml_mergekey = attr->children->content; - else if (!xmlStrcmp(attr->name, BAD_CAST "icu_chain") && + else if (!xmlStrcmp(attr->name, BAD_CAST "facetrule") && attr->children && attr->children->type == XML_TEXT_NODE) xml_icu_chain = attr->children->content; else diff --git a/src/pazpar2_config.h b/src/pazpar2_config.h index 8a1ae06..1906b85 100644 --- a/src/pazpar2_config.h +++ b/src/pazpar2_config.h @@ -81,7 +81,7 @@ struct conf_metadata enum conf_metadata_merge merge; enum conf_setting_type setting; // Value is to be taken from session/db settings? enum conf_metadata_mergekey mergekey; - char *icu_chain; + char *facetrule; }; diff --git a/src/session.c b/src/session.c index 00b70bb..fc021a8 100644 --- a/src/session.c +++ b/src/session.c @@ -197,7 +197,7 @@ void add_facet(struct session *s, const char *type, const char *value, int count for (i = 0; i < service->num_metadata; i++) if (!strcmp((service->metadata + i)->name, type)) - icu_chain_id = (service->metadata + i)->icu_chain; + icu_chain_id = (service->metadata + i)->facetrule; yaz_log(YLOG_LOG, "icu_chain id=%s", icu_chain_id ? icu_chain_id : "null"); if (!icu_chain_id) diff --git a/test/test_icu.cfg b/test/test_icu.cfg index f24007e..f343817 100644 --- a/test/test_icu.cfg +++ b/test/test_icu.cfg @@ -47,7 +47,7 @@ + merge="longest" rank="2" facetrule="mychain"/> -- 1.7.10.4