Sunday, April 9, 2017

Use another app's search index with Laravel Scout?

I have two different app (so two different laravel install). The 1st one has some models and it's data is indexed with Scout (using the TNT search driver, wich created index files on disk, if it's relevant).

Now I would like to use the 1st's models and data (that part is done, I just use the same model with a different connexion to the 1st app's database), but I would also like to use the 1st's index when using the search() method.

Is it at all possible? If so, what would be the required configuration to do?

At the moment, I need to re-index all of my data in the 2nd app, and it's a bit of a waste, because if I make any change in App nb. 1, the index won't update on app nb. 2.

The only idea I had at the moment (and I don't like it at all) would be to rsync the index files between the two apps, but there has to be some better way!

tl;dr: I have two app, and I want to use model/data/search index of one from the other app. Is it at all possible?



via Jean-Philippe Murray

Advertisement