Updated to use search model and calculate the total files