Gravatar for

Question by mnrichardstokes, Jul 25, 2014 11:48 AM

Media Type Facet

We are using Coveo for Sitecore and with the basic installation I do not see the Media Type as a Facet. We will be using both it for Intranet (using Sitecore) and for external sources. How would we configure this? Is it a special field name that we would use?

1 Reply
Gravatar for

Answer by Vincent Séguin, Jul 25, 2014 11:56 AM


I'm unsure what you mean by Media Type… on a Media Library item, you could have either Mime Type (such as image/png) or Extension (png). I would go with Mime Type. To configure this field as a facet, you should add it in your fieldMap in the Coveo.SearchProvider.config file, with the name media type, and setting the attribute isFacet="true"

See the reference here : Using the Sitecore Search Provider

For external sources, this is a bit different. It will depend on which build of Coveo for Sitecore you are. Currently, you would need to add the field manually on the external sources by the Coveo Admin Tool. Field names in Coveo are formatted like this : @mediaz95xtype12345, where 12345 is a hash of the source name.

You would need to add 3 fields on your external source, one for each database (web, master and core).

Starting from September, you will be able to simply add an attribute in your field called isExternal="true", and then you will be able to use the same name as the field on the external source.

Gravatar for

Comment by mnrichardstokes, Jul 25, 2014 12:19 PM

For media type I mean a facet that would display items like Web Page, PDF, Word, Excel. For our public site it used the @sysfiletype and icons were displayed to match the file type. We would like to match this.

So I assume I would have write code to translate something like @fmimetype46882 (and the others from the different sources) to the user friendly text correct? The September update will make things easier if we include external sources.

Gravatar for

Comment by Vincent Séguin, Jul 25, 2014 12:59 PM

What could be done is to code a PostConversion Script that uses the @fmimetype and sets it in the @sysfiletype value.

Then, with the September update, you will be able to add a facet on the @sysfiletype via Sitecore.

Ask a question