logic: fixed missing matches in fulltext search
This commit is contained in:
@@ -2787,22 +2787,32 @@ void PersistentStorage::buildFullTextSearchIndex() const
|
||||
m_fullTextSearchIndex.clear();
|
||||
|
||||
std::vector<std::shared_ptr<std::thread>> threads;
|
||||
for (std::vector<StorageFile> part : utility::splitToEqualySizedParts(m_sqliteIndexStorage.getAll<StorageFile>(), utility::getIdealThreadCount()))
|
||||
{
|
||||
std::shared_ptr<std::thread> thread = std::make_shared<std::thread>(
|
||||
[&](const std::vector<StorageFile>& files)
|
||||
std::vector<StorageFile> indexedFiles;
|
||||
for (const StorageFile& file : m_sqliteIndexStorage.getAll<StorageFile>())
|
||||
{
|
||||
if (file.indexed)
|
||||
{
|
||||
for (const StorageFile& file : files)
|
||||
indexedFiles.push_back(file);
|
||||
}
|
||||
}
|
||||
for (std::vector<StorageFile> part : utility::splitToEqualySizedParts(indexedFiles, utility::getIdealThreadCount()))
|
||||
{
|
||||
std::shared_ptr<std::thread> thread = std::make_shared<std::thread>(
|
||||
[&](const std::vector<StorageFile>& files)
|
||||
{
|
||||
m_fullTextSearchIndex.addFile(
|
||||
file.id,
|
||||
codec.decode(m_sqliteIndexStorage.getFileContentById(file.id)->getText())
|
||||
);
|
||||
}
|
||||
},
|
||||
part
|
||||
);
|
||||
threads.push_back(thread);
|
||||
for (const StorageFile& file : files)
|
||||
{
|
||||
m_fullTextSearchIndex.addFile(
|
||||
file.id,
|
||||
codec.decode(m_sqliteIndexStorage.getFileContentById(file.id)->getText())
|
||||
);
|
||||
}
|
||||
},
|
||||
part
|
||||
);
|
||||
threads.push_back(thread);
|
||||
}
|
||||
}
|
||||
for (std::shared_ptr<std::thread> thread : threads)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user