Navigation

Tridion 2011 Queries

Tridion R5.3 content delivery (CD) queries use a string-based query that represents basically the "select" part of an SQL query. For example, to filter a component that has select metadata you can use something like:

(key_value LIKE 'color') and (key_string_value LIKE 'red')
OR
(key_value LIKE 'size') and (key_string_value LIKE 'big')
OR
(key_value LIKE 'shape') and (key_string_value LIKE 'ball')
GROUP_BY 3 and publication_id = 5"

The reason for the GROUP_BY and all the LIKEs is because for R5.3, the metadata key_string_value are stored as comma separated lists. This seemingly minor change makes the inner, fumbling architect in me happy for some reason.

Tridion 2009/2011 changes this by giving Web developers objects in the .NET/Java (presentation server) code. These criteria objects abstract away the details of the queries making them easier to understand by abstracting the SQL details. See your latest documentation for examples or some gotchas next week during the community webinar on November 9, 2011.

No comments:

Post a Comment

Feel free to share your thoughts below.

Some HTML allowed including links such as: <a href="link">link text</a>.