[sloynik] Add dictionary size and number of keys to the stamp, so that when they change, index is regenerated.

This commit is contained in:
Yury Melnichek 2011-04-06 22:16:03 +02:00 committed by Alex Zolotarev
parent 37b094e886
commit 132ea3b946

View file

@ -10,10 +10,14 @@ sl::SloynikEngine::SloynikEngine(string const & dictionaryPath,
string const & indexPath,
StrFn const & strFn)
{
m_pDictionary.reset(new sl::SlofDictionary(new FileReader(dictionaryPath)));
FileReader * pDicFileReader = new FileReader(dictionaryPath);
// m_pDictionary takes ownership of pDicFileReader.
m_pDictionary.reset(new sl::SlofDictionary(pDicFileReader));
vector<uint64_t> stamp;
stamp.push_back(strFn.m_PrimaryCompareId);
stamp.push_back(strFn.m_SecondaryCompareId);
stamp.push_back(m_pDictionary->KeyCount());
stamp.push_back(pDicFileReader->Size());
string const stampPath = indexPath + ".stamp";
bool needIndexBuild = false;
try