X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=blobdiff_plain;f=src%2Frelevance.c;h=a33891765e30ec89add8a488fb9dd7a78ce77e5d;hb=0818e0450b743e626ef22adb9491831d547beffa;hp=86ba9ec4eb372050234e0e50250623f1bbce9b2f;hpb=18701a2fcad5171b03a76ceda18702831eb90850;p=pazpar2-moved-to-github.git diff --git a/src/relevance.c b/src/relevance.c index 86ba9ec..a338917 100644 --- a/src/relevance.c +++ b/src/relevance.c @@ -1,5 +1,5 @@ /* This file is part of Pazpar2. - Copyright (C) 2006-2008 Index Data + Copyright (C) 2006-2009 Index Data Pazpar2 is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -21,7 +21,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include #endif -#include #include #include @@ -309,10 +308,10 @@ void relevance_prepare_read(struct relevance *rel, struct reclist *reclist) } } // Calculate relevance for each document - for (i = 0; i < reclist->num_records; i++) + for (i = 0; i < reclist_get_num_records(reclist); i++) { int t; - struct record_cluster *rec = reclist->flatlist[i]; + struct record_cluster *rec = reclist_get_cluster(reclist, i); float relevance; relevance = 0; for (t = 1; t < rel->vec_len; t++) @@ -325,14 +324,16 @@ void relevance_prepare_read(struct relevance *rel, struct reclist *reclist) } rec->relevance = (int) (relevance * 100000); } - reclist->pointer = 0; + reclist_rewind(reclist); xfree(idfvec); } /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ +