I’m working on a personal Netflix style streaming site using Laravel 5.6 (with Laravel Scout), Vue 2.5.7, and Algolia with Vue InstantSearch version 1.7.0. I have two MySQL tables, ‘movies’ and ‘shows’. At times in my application I want to be able to search on both indices at the same time and combine the results into one result widget. I’m not sure how to do this. I’ve seen the code in the docs about a correlated multi-index search, but the results are treated as separate in that example. For some things, like the user’s watch history, I want the movies and TV shows combined and sorted in order of when they were last watched.
My first thought on how to do this was to make a MySQL view that combines the movies and shows tables and make an index off of that view. I managed to do this, but it feels hacky to me. Is there a better way to organize this?