3

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.

  • This only applies to Keyword fields in custom metadata, correct?

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

  • These would apply to Keyword fields in content or custom metadata?

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.

Neil
  • 2,688
  • 1
  • 23
  • 32
  • Why don't you just test the APIs and see the performance difference yourself. If you get stuck using an API, post the code snippet causing the problem and tell us what goes wrong. – Frank van Puffelen Nov 22 '12 at 13:49
  • Thanks Frank. That's of course an option, and I appreciate my question isn't regarding a specific problem. But this community is so damn useful its difficult not to try and tap into wider experiences when faced with a several options. – Neil Nov 22 '12 at 15:44

2 Answers2

2

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.

Dominic Cronin
  • 6,062
  • 2
  • 23
  • 56
0

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.

  • Hey Chris! True - but I think Keyword fields in content actually also end up in the ITEM_CATEGORIES_AND_KEYWORDS table with a reference to the item - this would allow the API to select content items for keywords in content fields. – Neil Nov 22 '12 at 13:36
  • 1
    All metadata fields **and all keyword fields** are published to the Broker. So keyword fields get published, even when they're in the content. – Frank van Puffelen Nov 22 '12 at 13:47