From: Sebastian Hammer Date: Wed, 17 Jan 2007 14:01:19 +0000 (+0000) Subject: Added support for date-value termlists X-Git-Tag: stable.27032007~73 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=acafc85244b61fdc7dc1aaa8bd98bb26f559dc07;p=pazpar2-moved-to-github.git Added support for date-value termlists --- diff --git a/src/pazpar2.c b/src/pazpar2.c index 2c05b8c..affac3f 100644 --- a/src/pazpar2.c +++ b/src/pazpar2.c @@ -1,4 +1,4 @@ -/* $Id: pazpar2.c,v 1.39 2007-01-16 23:42:10 quinn Exp $ */ +/* $Id: pazpar2.c,v 1.40 2007-01-17 14:01:19 quinn Exp $ */ #include #include @@ -667,7 +667,16 @@ static struct record *ingest_record(struct client *cl, Z_External *rec) if (md->rank) relevance_countwords(se->relevance, cluster, value, md->rank); if (md->termlist) - add_facet(se, type, value); + { + if (md->type == Metadata_type_year) + { + char year[64]; + sprintf(year, "%d", last); + add_facet(se, type, year); + } + else + add_facet(se, type, value); + } xmlFree(type); xmlFree(value); type = value = 0;