Mojave Stacks feature: More specificity for grouping

I am trying to use Mojave’s new Stacks feature that can group files on the desktop. I have it set to group by “Kind”. It created a stack called “Documents”. But the contents are very heterogeneous: this stack absorbs everything from Markdown documents through Mathematica notebooks to MS Word files.

I would much rather have these types separated. Is this possible?

For my use case, it would be sufficient to make the system consider Mathematica notebooks not to be “documents” (and let it mix the rest of the types).

Grouping by two columns in a table

I'm trying to create a very simple messaging system for a website and I am trying to group conversations by from or to using a single SQL statement. I have simplified the statement I am trying to use below:

$ messages_query = "SELECT * FROM tbl_messages WHERE from_id='$ current_user' OR to_id='$ current_user' GROUP BY from_id, to_id ORDER BY message_date DESC";

But ofcourse the grouping is a bit off. How would I get it to group by sender/receiver?