Search files by size or star-rating using spotlight
I'm trying to search files by their size or star-rating using Spotlight. I know it can be done using finder's Command+F, but I cannot figure out which is the syntax I should be using in Spotlight's textbook.

Here's what you need to do:
Use the search criteria, like this:

If you click on the menu there that says &quot;Kind&quot; (which is the currently selected criterion), you get a popup menu with options:

Choose Other... to get the complete list of possible criteria:

I think the one you're looking for is Rating, which is the user rating value. Click the checkbox on the right, as I have, to add it to the items that show up by default in the popup. Now you can add that as one of the criteria you're using to search, along with Name, Kind, etc. There are some other interesting photography-related criteria in the list: Exposure Time, F-number, ISO speed, etc.
Here's why it won't help:
In order for Spotlight to find files using attributes like Rating, some importer has to first provide data for that attribute to Spotlight. None of Apple's own photo storage applications (iPhoto, Aperture, Photos) seem to provide an importer that does this, and unless your favorite photo app does provide that data, Spotlight won't have any data in its index to search for.