How would you build full text search with yii2 ?

Yii2 is amazing because you get search model with gii. But as far as I understand you can search only from one model with it. If you have User model and UserSearch, you can make searchbox and search for users thanks to UserSeach. But what if you would like to search from multiple related models ? So if I have: User, Comment, and Post models, I would like to provide site search that will allow users to find text in either of these tables represented by models. Is there any cool, easy way of doing this with yii2 ? Or maybe you need to install additional extensions, server drivers, third party libraries and so on…

How would you do this ?

I’d do it with Sphinx or Elasticsearch.

Ditto, for something simple or a prototype you can use MySQL fulltext search but it is pretty noddy, elasticsearch is fabulous and simple to get started with. It also scales well whereas an RDBMS will degrade very early on.