Useful tips about Coveo For Sitecore


In my recent projects I used Coveo For Sitecore a lot and as much as I worked with it I started liking the beauty of Coveo For Sitecore. They way it’s implemented and  the way it’s making developer’s life easier I can say a best tool with most of the scenarios included which is actually a need of Search Result pages.

Let’s start with the points which I would like to talk about –

  1. Computed Index for multilist fields – Coveo automatically index the fields in older version which is present on items and in newer version  Coveo For Sitecore 5.x we need to allow fields from the Coveo dashboard if <IndexAllFields> is false. And I would say it’s pretty easy you just need to select your field which you want to index by clicking a simple checkbox.

    Now the point by default it index the raw value of multilist field which is collection of item ID’s and I am pretty sure we don’t want to show Item ID’s in our facets as well as other areas of Site.

    So we need to make a entry for Computed Field index for this. When I first started working with it I was not sure about it and missing the beauty of Covoe For Sitecore predefined implementations and somehow I came to know about it and that’s how I came to know that we don’t need to write even a single line of code if we want to show the field value of Multilist data-source items.

You just need to follow below steps to achieve the same –

  1. Open the Coveo.SearchProvider.Custom.config file (located under App_Config\Include\Coveo).
  2. Locate the fields element with a hint attribute equal to raw:AddComputedIndexField.
  3. Insert the configuration required for your computed field as shown below .
<fields hint="raw:AddComputedIndexField">
   <field fieldName="multilistfieldnametoindex" sourceField="Field name on source item" referencedFieldName="MultilistFieldNameOnItem">Coveo.SearchProvider.ComputedFields.ReferencedFieldComputedField, Coveo.SearchProviderBase</field>
 </fields>

This way it will start showing the Source Item field value in facet instead of Item ID’s.

There are many more options available for other fields like Date, Reference field etc…. you can check for them in below given link

https://docs.coveo.com/en/2251/coveo-for-sitecore-v5/creating-computed-fields

For Image you can follow the https://docs.coveo.com/en/2623/coveo-for-sitecore-v5/using-out-of-the-box-computed-fields post.

I don’t want to make this post boring so ending here hope it can at-least save your internet searching time. I am going to write next post which is for Extending the Reference field Computed index.

In normal case the given reference field logic will work but if the source item has any other Reference Field and we need to show the value of that Reference Selected item specific field value. To achieve this I have created a generic code which I am going to talk about in next post.

 

This entry was posted in Coveo, Coveo For Sitecore, Sitecore, Uncategorized and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s