<proxy host="localhost" port="80"/>
<service>
- <metadata name="title" brief="yes" sortkey="skiparticle" merge="longest"/>
+ <metadata name="title" brief="yes" sortkey="skiparticle" merge="longest" rank="6"/>
<!-- <metadata name="date" brief="yes" sortkey="numeric" type="year" merge="range"/> -->
- <metadata name="author" brief="yes" termlist="yes" merge="longest"/>
- <metadata name="subject" merge="unique" termlist="yes"/>
+ <metadata name="author" brief="yes" termlist="yes" merge="longest" rank="2"/>
+ <metadata name="subject" merge="unique" termlist="yes" rank="3"/>
</service>
</server>
-/* $Id: config.c,v 1.5 2007-01-08 18:32:35 quinn Exp $ */
+/* $Id: config.c,v 1.6 2007-01-08 19:39:12 quinn Exp $ */
#include <string.h>
xmlChar *merge = xmlGetProp(n, "merge");
xmlChar *type = xmlGetProp(n, "type");
xmlChar *termlist = xmlGetProp(n, "termlist");
+ xmlChar *rank = xmlGetProp(n, "rank");
if (!name)
{
else
md->termlist = 0;
+ if (rank)
+ md->rank = atoi(rank);
+ else
+ md->rank = 1;
+
if (type)
{
if (!strcmp(type, "generic"))
xmlFree(sortkey);
xmlFree(merge);
xmlFree(termlist);
+ xmlFree(rank);
md_node++;
}
else
char *name; // The name of this element. Output by normalization stylesheet
int brief; // Is this element to be returned in the brief format?
int termlist;// Is this field to be treated as a termlist for browsing?
+ int rank; // Rank factor. 0 means don't use this field for ranking, 1 is default
enum
{
Metadata_type_generic, // Generic text field
/*
- * $Id: http_command.c,v 1.10 2007-01-08 18:32:35 quinn Exp $
+ * $Id: http_command.c,v 1.11 2007-01-08 19:39:12 quinn Exp $
*/
#include <stdio.h>
struct conf_service *service = global_parameters.server->service;
int imeta;
+ yaz_log(YLOG_LOG, "Record, rank=%d", rec->relevance);
wrbuf_puts(c->wrbuf, "<hit>\n");
for (imeta = 0; imeta < service->num_metadata; imeta++)
{
-/* $Id: pazpar2.c,v 1.19 2007-01-08 18:32:35 quinn Exp $ */;
+/* $Id: pazpar2.c,v 1.20 2007-01-08 19:39:12 quinn Exp $ */;
#include <stdlib.h>
#include <stdio.h>
else
yaz_log(YLOG_WARN, "Don't know how to merge on element name %s", md->name);
- relevance_countwords(se->relevance, cluster, value, 4);
+ if (md->rank)
+ relevance_countwords(se->relevance, cluster, value, md->rank);
if (md->termlist)
add_facet(se, type, value);
xmlFree(type);
/*
- * $Id: relevance.c,v 1.5 2007-01-08 18:32:35 quinn Exp $
+ * $Id: relevance.c,v 1.6 2007-01-08 19:39:12 quinn Exp $
*/
#include <ctype.h>
#else
static int comp(const void *p1, const void *p2)
{
- struct record **r1 = (struct record **) p1;
- struct record **r2 = (struct record **) p2;
+ struct record_cluster **r1 = (struct record_cluster **) p1;
+ struct record_cluster **r2 = (struct record_cluster **) p2;
return (*r2)->relevance - (*r1)->relevance;
}
#endif