ContentstateId in Query

What’s the correct syntax for getting the state of an object in a query?

I’ve tried
SELECT rx:sys_contentstateid, rx:sys_contentid, rx:sys_folderid from rx:XXXXXX

but it throws an error.

I want my autoindexes only to return the public items.



The Item Filter typically handles the filtering of non-Public Content Items, not the JCR query.


So even though content items appear in the query, it doesn’t necessarily follow that they’ll appear in the AutoIndex?
So I don’t have to worry about archived or draft items then?

These items will appear in preview, but not when you actually publish.

You don’t need to worry about them when writing the JCR Query