This is a small gotcha in multilist with search field type introduced in Sitecore 7.0.

There are two ways to pass a pre-filter (i.e. the datasource) in the field definition:

  1. Regular querystring parameters
  2. Lucene query

There are certain rules that apply for the querystring passed as datasource:

  • the querystring parameter StartSearchLocation must be present, and its value must be a valid ID, e.g.
    StartSearchLocation={9D0686A2-5BFF-4DA0-B926-9276169D1707}
  • The lucene query part  must go into a querystring parameter called "Filter"
  • The lucene query part cannot contain spaces. Instead a pipe character ("|") is used to split the various parts, e.g.
    StartSearchLocation={9D0686A2-5BFF-4DA0-B926-9276169D1707}&Filter=+_path:9D0686A25BFF4DA0B9269276169D1707|_template:47485A7EAB1A424DB6FCA1B6947B6BB6|+parsedlanguage:english
  • As per this blog post, the _templatename lucene query parameter must NOT be preceded by a "+" sign.

What I've found out, is that you should not have duplication between the "querystring" part and the Lucene query part, as of 7.2. That is, the following would function "normally" in 7.0:

StartSearchLocation={9D0686A2-5BFF-4DA0-B926-9276169D1707}&TemplateFilter={47485A7E-AB1A-424D-B6FC-A1B6947B6BB6}&Language=english&Filter=+_path:9D0686A25BFF4DA0B9269276169D1707|_template:47485A7EAB1A424DB6FCA1B6947B6BB6|+parsedlanguage:english

Notice that the querystring parameters correspond 1-1 to the lucene query parts. The actual query has 3 parameters:

  • _path (StartSearchLocation)
  • _template (TemplateFilter)
  • _parsedlanguage (Language)

However, in Sitecore 7.2, the above datasource string does not work properly. When the field first loads, it shows up properly, with all the relevant items displayed on the left ("All") pane. However, if you try a search, the ajax requests that run to fetch the filtered data return an empty result without reporting any error.

To amend this, I chose to keep only the "querystring" part, discarding the "Filter" part altogether, since I could, based on the actual query. If the query was more involved, I might have to have kept the "Filter" parameter and made sure that the two parts don't overlap at all. So, the actual working query is:

StartSearchLocation={9D0686A2-5BFF-4DA0-B926-9276169D1707}&TemplateFilter={47485A7E-AB1A-424D-B6FC-A1B6947B6BB6}&Language=english

It is rather strange though, I'd expect that if you have a list, and you filter it, and then you re-apply the filter on the same list, you'd get the same filtered list again, not an empty set.