<record xmlns="http://www.indexdata.com/pazpar2/1.0"
mergekey="title The Shining author King, Stephen">
- <metadata type="title">The Shining</metadata>
+ <metadata type="title" rank="2">The Shining</metadata>
<metadata type="author">King, Stephen</metadata>
records are never merged. The 'metadata' elements provide the meat
of the elements -- the content. the 'type' attribute is used to
match each element against processing rules that determine what
- happens to the data element next.
+ happens to the data element next. The attribute, 'rank' specifies
+ specifies a multipler for ranking for this element.
</para>
<para>
elements of this type. The default is '0', which
excludes this element from the rank calculation.
</para>
+ <para>
+ For Pazpar2 1.6.13 and later, the rank may also defined
+ "per-document", by the normalization stylesheet.
+ </para>
</listitem>
</varlistentry>
struct record_metadata *rec_md = 0;
int md_field_id = -1;
int sk_field_id = -1;
+ int rank = 0;
+ xmlChar *rank_str = 0;
type = xmlGetProp(n, (xmlChar *) "type");
value = xmlNodeListGetString(xdoc, n->children, 1);
continue;
ser_md = &service->metadata[md_field_id];
+
+ rank_str = xmlGetProp(n, (xmlChar *) "rank");
+ if (rank_str)
+ {
+ rank = atoi((const char *) rank_str);
+ xmlFree(rank_str);
+ }
+ else
+ rank = ser_md->rank;
if (ser_md->sortkey_offset >= 0)
{
// ranking of _all_ fields enabled ...
- if (ser_md->rank)
+ if (rank)
+ {
relevance_countwords(se->relevance, cluster,
- (char *) value, ser_md->rank,
- ser_md->name);
+ (char *) value, rank, ser_md->name);
+ }
// construct facets ... unless the client already has reported them
if (ser_md->termlist && !client_has_facet(cl, (char *) type))