Sitecore’s SearchHits.Slice(int) method seems to change in Sitecore 6.6

I am working on a Sitecore 6.6 upgrade (yes, I know that that is still pretty much obsolete) and I came across a weird bug that took an age to track down. This is more a reminder for myself than anything else.

The code for Lucene searches frequently used lines of the form:

Slice Capture

List<SearchHit> distinctHits = hits.Slice(0).Distinct(new SearchHitEqualityComparer()).ToList();

This always returned zero SearchHits. It seems that this is due to the call to ‘Slice(0)‘ bit. This does raise some questions… Continue reading “Sitecore’s SearchHits.Slice(int) method seems to change in Sitecore 6.6”

Sitecore’s SearchHits.Slice(int) method seems to change in Sitecore 6.6

Enable SSL for sending emails on Sitecore

I was asked to use a GMail server to send emails from Sitecore with. This is actually a pretty reasonable request – but GMail only supports connections over TLS or SSL. Configuring Web Forms for Marketers to use this was proving … interesting, until I found this excellent article by Mark CassidyContinue reading “Enable SSL for sending emails on Sitecore”

Enable SSL for sending emails on Sitecore

Awkward SharePoint Link field text

I had a gnarly support call today. One of our customers was using Announcement lists to display news on the homepage of their intranet, and they’ve a thumbnail image they’d set for each item. Then, on the home page, they’ve got a Content Query Web Part using some custom XSL to render those announcements.

However, the Content Query Web Part would only show some of the thumbnail images.Capture

TL;DR – Saving an image field on a ‘New’ form without a descripion saves a different format to after an ‘Edit’, which sets a default even if you don’t change the image field value.

Continue reading “Awkward SharePoint Link field text”

Awkward SharePoint Link field text

Make Sitecore record the class writing to the logs

I’m a big fan of writing into your logs the class and method that is currently executing – it makes fault finding so much easier. Typically I’d do this with reflection – but it turns out that you can do this with a small change to Sitecore’s configurationContinue reading “Make Sitecore record the class writing to the logs”

Make Sitecore record the class writing to the logs

Appending to the _content field in Sitecore Search 7.2 and 7.5

The _content field in Lucene for Sitecore is basically the full text index. If you index things like PDFs, Word documents, etc., then the results of the IFilter get stored in the _content field.

You can add computed fields into the _content field simply by specifying them with the name ‘_content’. However, I found some differences with how patch files behave.  Continue reading “Appending to the _content field in Sitecore Search 7.2 and 7.5”

Appending to the _content field in Sitecore Search 7.2 and 7.5

Awkward Sitemap XML module

So, I was reviewing a few Sitecore log files for a customer of ours, and I kept coming across the following entries.

ManagedPoolThread #15 10:26:56 WARN The serachengine "Http://google.com/webmasters/sitemaps/ping?sitemap=sitemap.xml" returns an 404 error
ManagedPoolThread #15 10:26:57 WARN The serachengine "http://search.yahooapis.com/SiteExplorerService/V1/ping?sitemap=sitemap.xml" returns an 404 error

Capture2
This struck me as interesting. These are calls to different search providers to tell them that your site’s sitemap file has been updated, and should be read again (so that new content could be indexed). This is all from a nice little module on Sitecore Marketplace. We use it quite a lot. However, I spotted a few issues… Continue reading “Awkward Sitemap XML module”

Awkward Sitemap XML module