Skip to content

Commit

Permalink
fixed #32 - fold_lemmas=1 vs hit count
Browse files Browse the repository at this point in the history
  • Loading branch information
glookka authored and klirichek committed Jul 18, 2017
1 parent 7d8cd87 commit 123a9f0
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/sphinx.cpp
Expand Up @@ -16744,6 +16744,13 @@ void ISphQueryFilter::GetKeywords ( CSphVector <CSphKeywordInfo> & dKeywords, co
dKeywords.Resize ( dKeywords.GetLength()-1 );
} else
{
int iKeywordWithMaxHits = iPreAotCount;
for ( int i=iPreAotCount+1; i<dKeywords.GetLength(); i++ )
if ( dKeywords[i].m_iHits > dKeywords[iKeywordWithMaxHits].m_iHits )
iKeywordWithMaxHits = i;

CSphString sNormalizedWithMaxHits = dKeywords[iKeywordWithMaxHits].m_sNormalized;

int iDocs = 0;
int iHits = 0;
if ( m_tFoldSettings.m_bStats )
Expand All @@ -16758,6 +16765,7 @@ void ISphQueryFilter::GetKeywords ( CSphVector <CSphKeywordInfo> & dKeywords, co
dKeywords.Resize ( iPreAotCount );
dKeywords[iTokenized].m_iDocs = iDocs;
dKeywords[iTokenized].m_iHits = iHits;
dKeywords[iTokenized].m_sNormalized = sNormalizedWithMaxHits;
}
}
}
Expand Down

0 comments on commit 123a9f0

Please sign in to comment.