FieldTemplateId as SearchRequest ReadTag

Is it possible to get a products field template id as a read tag when searching products?

In the Search method of ProductSearchService you can add Readtags to the Searchrequest like this.

request.ReadTags.Add(TagNames.ArticleNumber);

I notice there’s a TagName.TemplateId but that doesn’t add any tag to the search response hits tags when searching for products. Is this a bug or isn’t the TagName.TemplateId applicable on products?

Litium version: 7.2

Hi,
Only the field template name is indexed as read tag. You can get the tag name via
var fieldTemplateName = TagNames.AppendLanguage(TagNames.TemplateName, language);
If you want to get the FieldTemplateSystemId or FieldTemplateId you have to index that one in your solution via hooking in the indexing process by implementing IIndexingProviderPreProcessor.
SeeCampaignIndexingProviderPreProcessor in the accelerator as an example of IIndexingProviderPreProcessor.

Thanks Utku you pointed me in the right direction.

We solved it by creating an IndexingProviderPreProcessor where we simply set the Readable property of the TemplateId tag to true.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.