Index: matcher/localmatch.cc
===================================================================
RCS file: /usr/data/cvs/xapian/xapian-core/matcher/localmatch.cc,v
retrieving revision 1.118
diff -p -u -r1.118 localmatch.cc
--- matcher/localmatch.cc	19 Jun 2003 16:57:39 -0000	1.118
+++ matcher/localmatch.cc	18 Aug 2004 17:12:24 -0000
@@ -375,7 +375,6 @@ LocalSubMatch::postlist_from_query(const
 	case Xapian::Query::Internal::OP_LEAF: {
 	    // Make a postlist for a single term
 	    Assert(query->subqs.size() == 0);
-	    Xapian::MSet::Internal::TermFreqAndWeight info;
 
 	    // FIXME: pass the weight type and the info needed to create it to
 	    // the postlist instead (why?)
@@ -392,15 +391,23 @@ LocalSubMatch::postlist_from_query(const
 		AssertEqDouble(wt->get_maxextra(), temp_wt->get_maxextra());
 #endif
 	    }
-	    info.termweight = wt->get_maxpart();
 
-	    // MULTI - this statssource should be the combined one...
-	    info.termfreq = statssource->get_total_termfreq(query->tname);
+	    map<string, Xapian::MSet::Internal::TermFreqAndWeight>::iterator i;
+	    i = term_info.find(query->tname);
+	    if (i == term_info.end()) {
+		Xapian::MSet::Internal::TermFreqAndWeight info;
+		info.termweight = wt->get_maxpart();
 
-	    DEBUGLINE(MATCH, " weight = " << info.termweight <<
-		      ", frequency = " << info.termfreq);
+		// MULTI - this statssource should be the combined one...
+		info.termfreq = statssource->get_total_termfreq(query->tname);
 
-	    term_info.insert(std::make_pair(query->tname, info));
+		DEBUGLINE(MATCH, " weight = " << info.termweight <<
+			  ", frequency = " << info.termfreq);
+
+		term_info.insert(std::make_pair(query->tname, info));
+	    } else {
+		i->second.termweight += wt->get_maxpart();
+	    }
 
 	    // MULTI
 	    LeafPostList * pl = db->open_post_list(query->tname);
