Improved version of create search records

Not the final but better than the present one