Thursday, October 2, 2014

Don’t use managed properties with a dot (but the fix is easy)

KQL does not work with managed properties having a . in the name. (FQL however does).

This means if you try to query against a managed property named for example mAdcOW.CoolProp, you will get zero results back.

Two possible solutions, either rename your property or give it an alias. Using an alias is probably the better solution and allows you to give nice readable names to your properties. The alias feature is also nice when dealing with the re-usable RefinableXXYY properties, so as to name them properly.

In my case an alias was the way as the property was auto generated from a scenario like this:
  1. Site column with internal name mAdcOW.CoolDate
  2. Auto generated crawled property: ows_q_DATE_mAdcOW.CoolDate
  3. Auto generated managed property: mAdcOW.CoolDateOWSDATE
  4. Mikael manually added alias mAdcOWCoolDate
Hence, mAdcOW.CoolDateOWSDATE:Z does not work, while mAdcOWCoolDate:Z does work.

Using .'s in internal column names is pretty common for programmers to divide namespaces as part of the name, and usually they work out well. You could always change the naming of column names to avoid the propagation of dots to managed properties, but using an alias will still yield prettier names.