I have used the following code to create a content delivery query on 2011 SP1 - HR1.
string[] results = null;
using (Criteria isOrganisatie = new ItemSchemaCriteria(this.OrganisatieSchemaID))
using (Criteria matchesKeyword = new TaxonomyKeywordCriteria(
this.CategoryURI, organisatieFilterURI, true))
using (Criteria isOrganisatieAndMatchesKeyword
= CriteriaFactory.And(isOrganisatie, matchesKeyword))
using (Query organisatiesQuery = new Query(isOrganisatieAndMatchesKeyword))
{
results = organisatiesQuery.ExecuteQuery();
}
When executed, this gives the following error.
org.hibernate.hql.ast.QuerySyntaxException: unexpected token: )
near line 1, column 392 [select distinct im.publicationId, im.itemId,
im.itemType,im.itemId from com.tridion.storage.ItemMeta im,
com.tridion.storage.TaxonomyItem as JOIN3TF, com.tridion.storage.TaxonomyItem as
JOIN3TF1, com.tridion.storage.RelatedKeyword as JOIN3
,com.tridion.storage.ComponentMeta as JOIN2 where (im.itemId=JOIN2.itemId and
im.publicationId=JOIN2.publicationId and JOIN2.schemaId=:schemaId4 AND ) ORDER BY
im.itemId ASC]
The interesting part of this is AND ) ORDER BY
- that AND has obviously got no business being there.
Is this caused by the way I've written my query? (I've tried various other approaches, but with similar results). Is this a known issue?
this.CategoryURI
andorganisatieFilterURI
valid URIs? If so then that looks like a defect, although I haven't kept up with the hotfixes on the CD side, might be know and fixed already...