v.22.8Bug Fix

Fix bug in collectFilesToSkip() for index file extensions

Fix bug in collectFilesToSkip() by adding correct file extension (.idx or idx2) for indexes to be recalculated, avoid wrong hard links. Fixed #39896. #40095 (Jianmei Zhang).