I am going to assume the way you have implemented this is that your application has a search component that searches for known topics, loads the videos, extracts subs and stores them in vectorized format inside a database. when a user searches for something you simply lookup this vector data and link the YT video corresponding to it