Rename metadata attribute icu_chain to facetrule
authorAdam Dickmeiss <adam@indexdata.dk>
Wed, 14 Sep 2011 11:06:48 +0000 (13:06 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Wed, 14 Sep 2011 11:06:48 +0000 (13:06 +0200)
This is have the possiblity to override other than just facet
normalization per metadata field in the future.

src/pazpar2_config.c
src/pazpar2_config.h
src/session.c
test/test_icu.cfg

index 8fec8cc..8a7b651 100644 (file)
@@ -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
index 8a1ae06..1906b85 100644 (file)
@@ -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;
 };
 
 
index 00b70bb..fc021a8 100644 (file)
@@ -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)
index f24007e..f343817 100644 (file)
@@ -47,7 +47,7 @@
       <metadata name="date" brief="yes" sortkey="numeric" type="year" merge="range"
                termlist="yes"/>
       <metadata name="author" brief="yes" termlist="yes"
-                merge="longest" rank="2" icu_chain="mychain"/>
+                merge="longest" rank="2" facetrule="mychain"/>
       <metadata name="subject" merge="unique" termlist="yes" rank="3"/>
       <metadata name="id"/>
       <metadata name="lccn" merge="unique"/>