How to create Facet search in Yii2

Hi guys! I want to build facet search for this query:

**select** RIDLuogo1, **count**(RIDLuogo1) from **bibliografie** **group by** RIDLuogo1

This query show the places of edition for each authors.
How can I do? I think sphinx is the best way, but if it is possible, I don’t want to use it, because the documents are few.

Thank you very much!!