From bcfbff305ebc5784f8ce702bd239f163acc31660 Mon Sep 17 00:00:00 2001 From: shodan Date: Tue, 31 Aug 2010 00:30:49 +0000 Subject: [PATCH] lets scale weights by index_weights when grouping, too git-svn-id: http://sphinxsearch.googlecode.com/svn/trunk@2472 8b96e2b9-35c5-2c16-bc47-5122d61876d4 --- src/searchd.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/searchd.cpp b/src/searchd.cpp index 68ec7336..0159d34e 100644 --- a/src/searchd.cpp +++ b/src/searchd.cpp @@ -4585,8 +4585,15 @@ bool MinimizeAggrResult ( AggrResult_t & tRes, const CSphQuery & tQuery, bool bH // groupby sorter does that automagically pSorter->SetMVAPool ( NULL ); // because we must be able to group on @groupby anyway ARRAY_FOREACH ( i, tRes.m_dMatches ) - if ( !pSorter->PushGrouped ( tRes.m_dMatches[i] ) ) + { + CSphMatch & tMatch = tRes.m_dMatches[i]; + + if ( tRes.m_dIndexWeights.GetLength() && tMatch.m_iTag>=0 ) + tMatch.m_iWeight *= tRes.m_dIndexWeights[tMatch.m_iTag]; + + if ( !pSorter->PushGrouped ( tMatch ) ) iDupes++; + } } else { // normal sorter needs massasging