How to display the “Search in App” button in Spotlight?

Previous I thought that this is something only Apple apps can do, but I just noticed that Google drive can do that too. But I couldnt find the documentation for that. Does anyone know? thanks!

How to display the “Search in App” button in Spotlight?
 
 
Q