Numerous times in recent years I’ve had to use Reflector Pro to debug third-party dlls. While this works well and allows you to step through code as if it was your own the value of doing so can be completely lost if you cannot see critical object values due them being ‘optimized away’.
Recently I was stuck with a problem of optimization that refused to be disabled by the usual means that I’d used in the past. I stumbled onto a neat trick which finally did work, but it also clarified what happens when the web application, usually Sitecore CMS, restarts.
Using the new Sitecore contentsearch api allows you search against a lucene index with very little effort. Examples are a bit short on the ground but using Linq you can find yourself doing something like this to search for an item by name, somewhere within a folder structure:
public void BadSearch(string searchTerm)
var webIndex = ContentSearchManager.GetIndex("sitecore_web_index");
using (var context = webIndex.CreateSearchContext())
var results = context.GetQueryable<SearchResultItem>().Where(i =>
i.Name == searchTerm &&
i.Path.StartsWith("sitecore/content/stuff/")); // don't do this!
This may well work. However you may also run into a Lucene error stating that you are using too many clauses, the default limit is 1024.
This XmlException can occur within a Sitecore site where a general link field contains just plain text, for example a template flipped from link field to text field or just editing in raw.
Clear the field and re-populate with a valid target.
Still much tidying up to do, but a working v0.5 alpha release now up on Codeplex
Please report any bugs or issues via Codeplex.
Fixes broken language prefix handling. Also includes multiple breaking changes since previous v0.4 release in SQL (columns, index, constraints) and codebase (interface).
A quick post to say that I’ve finally uploaded my shared source ‘Redirect Manager’ module to http://trac.sitecore.net/RedirectManager/
This is part 2 of 2 posts on detailed Sitecore.Linkmanager configuration.
Urls for sitecore items are generated by the static class Sitecore.Links.LinkManager. In normal use you wont have any issues, but things can get trickier when you step out of a simple scenario.
There isn’t anything new here, more a case of just wrapping up some posts and tying some events together.
Update April 2011: This post and part 2 are now irrelevant for Sitecore 6.x See this post for details of important changes since this post was first published
If you want to duplicate the solution to add to a new source control system.