I'm using the following query for a content view using Studio:
ecm:mixinType != 'HiddenInNavigation' AND ecm:isCheckedInVersion = 0 AND ecm:currentLifeCycleState != 'deleted' AND zdoctype:ztype ILIKE 'zaxis_customer' AND ZCUSTII:Contact/*/ContactEmail ILIKE '%ZC1236%'
The Contact field is a complex list within which one of the fields is ContactEmail and I'm trying to search for the ZC1236 pattern and list all the documents which contain that email pattern.
When executed I get the following error:
SELECT DISTINCT, ORDER BY expressions must appear in select list.
It seems I do not have control, in Studio, with where the SELECT DISTINCT AND ORDER BY expression appear in the query.
Can this type of query work in studio content view?
The following query works in nuxeo shell:
Select * FROM Customer Where ( ecm:mixinType != 'HiddenInNavigation' AND ecm:isCheckedInVersion = 0 AND ecm:currentLifeCycleState != 'deleted' AND ZCUSTII:Contact/*/ContactEmail ILIKE '%ZC1236%')
Ultimately I'd like to take an email address and query the customer documents for a match then relate that email to the customer document.