Hello-
I am trying to do a search with the SQL syntax and I am running into
issues.
My query is:
SELECT * FROM nt:base where jcr:path like '/RTC/projects/%' and
contains (*, 'sector_type_commercial') AND contains
(*,'project_type_archdesign')
sector_type_commercial and project type_archdesign are both values in
checkbox groups.
My query shows up 0 results - when I change it to and OR instead of
and AND or remove the last contains I get results. I cannot seem to
search more than one set of checkboxes...
Thanks,
-chris
the following is the xml output of a content node which my help
diagnose my problem.
<sv:node sv:name="projectType">
<sv:property sv:name="jcr:primaryType" sv:type="Name">
<sv:value>mgnl:contentNode</sv:value>
</sv:property>
<sv:property sv:name="jcr:mixinTypes" sv:type="Name">
<sv:value>mix:versionable</sv:value>
</sv:property>
<sv:property sv:name="jcr:uuid" sv:type="String">
<sv:value>5a747089-3c23-44f7-8819-3574293425de</sv:value>
</sv:property>
<sv:property sv:name="jcr:isCheckedOut" sv:type="Boolean">
<sv:value>true</sv:value>
</sv:property>
<sv:property sv:name="1" sv:type="String">
<sv:value>project_type_archdesign</sv:value>
</sv:property>
<sv:property sv:name="11" sv:type="String">
<sv:value>project_type_publictrans</sv:value>
</sv:property>
<sv:property sv:name="10" sv:type="String">
<sv:value>project_type_transengineer</sv:value>
</sv:property>
<sv:property sv:name="9" sv:type="String">
<sv:value>project_type_structengineer</sv:value>
</sv:property>
<sv:property sv:name="7" sv:type="String">
<sv:value>project_type_environengineer</sv:value>
</sv:property>
<sv:property sv:name="mgnl:uuid" sv:type="String">
<sv:value>8e788685-15c7-11db-ac5d-edcb9eccafed</sv:value>
</sv:property>
<sv:property sv:name="0" sv:type="String">
<sv:value>project_type_progconst</sv:value>
</sv:property>
<sv:property sv:name="3" sv:type="String">
<sv:value>project_type_electengineering</sv:value>
</sv:property>
<sv:property sv:name="4" sv:type="String">
<sv:value>project_type_gis</sv:value>
</sv:property>
<sv:property sv:name="6" sv:type="String">
<sv:value>project_type_electutility</sv:value>
</sv:property>
<sv:property sv:name="jcr:created" sv:type="Date">
<sv:value>2006-07-17T15:07:57.050-04:00</sv:value>
</sv:property>
<sv:property sv:name="5" sv:type="String">
<sv:value>project_type_civengineering</sv:value>
</sv:property>
<sv:property sv:name="2" sv:type="String">
<sv:value>project_type_mecheleengin</sv:value>
</sv:property>
<sv:property sv:name="8" sv:type="String">
<sv:value>project_type_surveymap</sv:value>
</sv:property>
<sv:node sv:name="MetaData">
<sv:property sv:name="jcr:primaryType" sv:type="Name">
<sv:value>nt:file</sv:value>
</sv:property>
<sv:property sv:name="jcr:created" sv:type="Date">
<sv:value>2006-07-17T15:07:57.051-04:00</sv:value>
</sv:property>
<sv:node sv:name="jcr:content">
<sv:property sv:name="jcr:primaryType" sv:type="Name">
<sv:value>nt:unstructured</sv:value>
</sv:property>
<sv:property sv:name="Data" sv:type="String">
<sv:value>MetaData</sv:value>
</sv:property>
<sv:property sv:name="creationdate" sv:type="Date">
<sv:value>2006-07-17T15:07:57.051-04:00</sv:value>
</sv:property>
</sv:node>
</sv:node>
</sv:node>
<sv:node sv:name="projectMarketSector">
<sv:property sv:name="jcr:primaryType" sv:type="Name">
<sv:value>mgnl:contentNode</sv:value>
</sv:property>
<sv:property sv:name="jcr:mixinTypes" sv:type="Name">
<sv:value>mix:versionable</sv:value>
</sv:property>
<sv:property sv:name="jcr:uuid" sv:type="String">
<sv:value>17282d18-32ce-47a3-bf0c-53d515b50929</sv:value>
</sv:property>
<sv:property sv:name="jcr:isCheckedOut" sv:type="Boolean">
<sv:value>true</sv:value>
</sv:property>
<sv:property sv:name="1" sv:type="String">
<sv:value>sector_type_correctional</sv:value>
</sv:property>
<sv:property sv:name="mgnl:uuid" sv:type="String">
<sv:value>8e7922c6-15c7-11db-ac5d-edcb9eccafed</sv:value>
</sv:property>
<sv:property sv:name="0" sv:type="String">
<sv:value>sector_type_commercial</sv:value>
</sv:property>
<sv:property sv:name="3" sv:type="String">
<sv:value>sector_type_industrial</sv:value>
</sv:property>
<sv:property sv:name="4" sv:type="String">
<sv:value>sector_type_infrastructure</sv:value>
</sv:property>
<sv:property sv:name="6" sv:type="String">
<sv:value>sector_type_residential</sv:value>
</sv:property>
<sv:property sv:name="jcr:created" sv:type="Date">
<sv:value>2006-07-17T15:07:57.054-04:00</sv:value>
</sv:property>
<sv:property sv:name="5" sv:type="String">
<sv:value>sector_type_institutional</sv:value>
</sv:property>
<sv:property sv:name="2" sv:type="String">
<sv:value>sector_type_government</sv:value>
</sv:property>
<sv:node sv:name="MetaData">
<sv:property sv:name="jcr:primaryType" sv:type="Name">
<sv:value>nt:file</sv:value>
</sv:property>
<sv:property sv:name="jcr:created" sv:type="Date">
<sv:value>2006-07-17T15:07:57.054-04:00</sv:value>
</sv:property>
<sv:node sv:name="jcr:content">
<sv:property sv:name="jcr:primaryType" sv:type="Name">
<sv:value>nt:unstructured</sv:value>
</sv:property>
<sv:property sv:name="Data" sv:type="String">
<sv:value>MetaData</sv:value>
</sv:property>
<sv:property sv:name="creationdate" sv:type="Date">
<sv:value>2006-07-17T15:07:57.055-04:00</sv:value>
</sv:property>
</sv:node>
</sv:node>
</sv:node>
----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------