Neil
Neil

Reputation: 2688

Tridion 2011 SP1 CD API - retrieve content tagged with keyword

We're designing schemas for content that we want to retrieve via the CD API based upon a Keyword field. From an API point of view, I'm wondering if it makes a difference if this field is a Content field or a Metadata field:

Looking at the API docs, there's a TaxonomyKeywordCriteria available to query all content which are related to a specific Keyword which I can pass to Query object.

There's also the TaxonomyRelationManager class which has a GetTaxonomyContent method as well as the GetTaxonomyComponentPresentations method in the ComponentPresentationFactory class.

Is there any performance difference between the API calls to be aware of?

The Keyword field is important from an editorial point of view so I'm leaning towards creating it as content field rather than it being "hidden" under the metadata tab.

Cheers

EDIT

Initial (quick & dirty!) tests show TaxonomyRelationManager is x10 quicker than ComponentPresentationFactory, which is x1.5 quicker that Query.

However ComponentPresentationFactory contains actual content rather than just TCM IDs which could be more useful in my scenario.

Upvotes: 3

Views: 211

Answers (2)

Dominic Cronin
Dominic Cronin

Reputation: 6201

Normal content fields don't automatically get published to the broker. Keyword fields are the exception to this: a keyword field is automatically metadata even if it's on the content tab.

I see you've already answered the performance part of your question yourself.

Upvotes: 2

user590557
user590557

Reputation:

As far as I'm aware only Metadata fields get published to the Broker, Content fields don't. So if you need to query against the keyword field it would need to be a Metadata field.

Upvotes: 0

Related Questions