Coveo Sorting Part 1 – On the Rendering

Coveo provides lot of tools and places where you could provide a sort mechanism.  First things first, sort is the most important piece that goes with listing.  If the listing of search results that you are showing to end user are not sorted per either business drive or more power to user where the user could actually select how he/she wants to sort their results is the key for the user to be able to find what they are looking for.

Steps to get sorting working
  1. Firstly define which field either sitecore or computed field you are going to use as a sort field.
  2. Note that OOTB, not all fields are sortable and you will need to configure and ensure that the field you are going to base the sort on is Coveo sortable.  For example – string fields are not inherently sortable while number fields are.
  3. If the field you decided as sort field is not inherently sortable, configure it per directions listed here by Coveo documentation and rebuild your indexes.
    https://developers.coveo.com/display/public/SitecoreV4/Making+a+Sitecore+Field+Sortable
  4. After this step, always do a sanity check on admin tool that this field has a checkbox for sortable.

Now that you have basic configuration ready, the next step is fairly simple.  Go to presentation on the template which has your coveo rendering on which you would like to apply sort.  Pull open the properties of Coveo rendering and you will see a Default Sort order section like below.  Input three parameters it looks for –
  • Default Sort Type – Field | Date | Relevancy – I found Field and Date to be extremely useful
  • Default Sort Direction – Ascending | Descending
  • Default Sort Field – You have a pick list provided by Coveo which is a searchbox where you can type and find the sortable field you are looking for.  We are using December 2016 version of Coveo which has an active bug, so, we had to use GUID as a workaround instead of using field picker. See an example on the screenshot below

After you pick everything coveo is expecting, give it a spin – Go to the page where this rendering exists and check what is happening on the query request. You should see the below two populate with the field you picked and direction you mentioned on default sort order. If you do not see this then the sort would not be working and you will have to debug further. Couple times, it is due to presentation being overridden, so try resetting it before you panic. 😱

Now, all this works beautifully if you have just the basic Coveo custom rendering on your page.  Now, how will you make sort work with tabs, how about facet ordering.  What happens when you have both going.  How about if you need to apply sort ordering on a custom or computed field.  I will post details about these scenarios soon.  More to come later….Sorting O what fun. 😆
Happy Sitecoring and have fun every one.  Between, on a side note, last month I presented at LASUG about Coveo, if you wanna to check it out here is the link to youtube video.  Post your comments.

Coveo facets error

Coveo Facets Error 

So, you are on September release of coveo components and you do not have tab component on your search view.  You now want to add coveo facet or the view, which was added fine, but the facet though indexed and pointing to correct field, it would either not render fine on view, what would you do ??? 
I tried doing the below…
  • Checked conside and tried to debug error 
    •  Actual Error – ‘Value can not be null or empty ‘ 
  • What value is coveo asserting for ?checked call stack,  nothing important is missing 
  • Checked Presentation Details and ensured that everything is set correctly. 
  • Dropped facet component , no error any more …??
  • Slack conversation with Coveo team , no break through!!!! They asked to check if I am not hard coding ‘Model .ID’ like plain text, but, nope we were doing things the correct way. 

What else ??? Google should have been my first resort, but I like to do basic checks first, seems like I should follow the reverse order. 

Found below link and seemed very much related, so gave it a shot.  That’s it!!!
It started working. Yippeeee!
Hope, this would help some one battling this issue and unaware that it is a known issue on September release. 
Few Screen Shots of Error for reference 

Item Publish and Save Random Errors(Coveo)

Sitecore Item Publish and Save Errors

One day, though I did not do any specific config level changes, I started getting lot of errors, items were not saving, publish was not happening.  Same object reference errors on every single major operation on my sitecore instance.
I looked at the logs and see bunch of Coveo related errors, Yes, I had Coveo installed on this instance.  I ran the diagnostic tool of Coveo and see bunch of services having issues.  Even the indexing was broken.  It seems Coveo patches on to lot of Item pipelines like save, publish, etc.,
To debug this, there are few common steps you need to do and for most cases below should work.
In my case, I was using Windows Credentials for Coveo services and I had changed my password. 😉
But, it could be other service related issues that could be causing it –  So, the traditional magic steps are –

1. Ensure Coveo Diagnostic is all green
2. Go to Windows Services and ensure all Coveo services are up and running.
  Note – Some times the services show up as running, but, infact they would be broken.  When issues persist, try to stop and restart service after ensuring credentials are correct.
3. Tip – wait for few seconds before starting the service after you stop it
4. Re-index all Coveo Indexes
5. Check Diagnostics again to ensure

These steps should help most of issues specifically when everything is installed correctly initially.
As always Coveo first time install is always rough on newbies.  But, slowly you will get good hang of it, once you know the components.

Good Reads –
https://developers.coveo.com/display/public/SitecoreV3/Troubleshooting+Problems+Using+the+Coveo+Diagnostic+Page;jsessionid=2E0BEDF7A39D390CB791743AAE57FF87

https://developers.coveo.com/display/public/SitecoreV3/Resolving+Coveo+for+Sitecore%27s+Most+Common+Issues

Coveo – Windows 10 CES install fatal error

CES Install failure on Windows 10

I am not sure if any one encountered this before, Coveo pre-requisites on latest June 2016 version of CES failed on my local(this used to work fine before), The only change I realized this time was I am using Windows 10.  I had .netframework 3.5 enabled already, but, Coveo installer was trying to install again causing fatal error.  I could not move forward with installation.. Upon research I found the below issue on Coveo Q&A site.  I followed it and it worked.  It’s kind of not fair that I need to do regedit to make CES install fine. 
I added my concern up on the below Coveo question and answers as well.  Let’s see if Coveo does something for us not to have to edit the windows registry to make their product work.

More details on the link below –

https://answers.coveo.com/questions/5344/ces-fails-to-install-net-35-sp1-when-its-already-installed

Screenshot for reference on what i did to make this work.
Note – Make sure you create a system restore point and back up your original key before modification, just in case if it causes issues you can revert your changes