SharePoint 2010 Search: Some Managed Properties cannot be included in queries

by Ради Атанасов 24. November 2010 15:47

A colleague today showed me a problem he was having with full text search queries. All he was doing is including the ContentType managed property in the search query, which returned a Microsoft.Office.Server.Search.Query.InvalidPropertyException.

The reason for this is that the Content Type field is now marked as non-retrievable. The ManagedProperty class has a “Retrievable” property, which according to this MSDN article, specifies whether it can be used in queries: microsoft.office.server.search.administration.managedproperty.retrievable.aspx

According to this blog post, it used to be retrievable in SharePoint 2007. Definitely a gotcha - most people would think this is possible, and most may also sell it in a client meeting.

The problem is that you cant set it to true… I currently have no solution for this, but I thought I might post a list of ALL managed properties (in a default installation with very few content) that have Retrievable set as False.

PowerShell script to check properties:

Get-SPEnterpriseSearchMetadataManagedProperty -SearchApplication "Search Service Application" | where {$_.Retrievable -eq $false}

Results:

Account
BestBetKeywords
CategoryNavigationUrl
Colleagues
ContentsHidden
ContentSource
ContentType
DocComments
DocKeywords
DocSignature
DocSubject
EndDate
ExcludeFromSummary
ExpirationTime
FollowAllAnchor
HostingPartition
ModifiedBy
NLCodePage
Notes
OWS_URL
PrivateColleagues
Purpose
RankingWeightHigh
RankingWeightLow
RankingWeightName
SiteID
SocialTagTextUrl
SPSiteURL
StartDate
UrlDepth
WikiCategory

OK so I looked into it further, I tried setting it in the Search SA to be included in all results, but that didn’t work:

image

clip_image001

And adding it in the advanced search web part also doesn’t work:

clip_image001[6]

The query will return no results. Trying to set the property to True in PowerShell or the OM still gives the same error.

So, the only workable solution that is flying around is the one posted on the MSDN forums. It still, however, is a workaround that can’t be used in ALL situations out there. This is not great, as one would think the ContentType field is something you would want to include in your search results.

Please let me know if you find any other solutions.

Tags: , ,

English

Comments

11/24/2010 5:28:43 PM #

pingback

Pingback from topsy.com

Twitter Trackbacks for
        
        SharePoint.BG: Radi Atanassov | SharePoint 2010 Search: Some Managed Properties cannot be included in queries
        [sharepoint.bg]
        on Topsy.com

topsy.com | Reply

11/24/2010 5:45:31 PM #

Marek Czarzbon

Nice!
But what about 'contenttype:<mycontenttype>' directly in the search field, which you can use also in code behind.

Marek

Marek Czarzbon | Reply

11/24/2010 5:57:34 PM #

Marek Czarzbon

This is even more interesting! If you use 'contenttype:document' or 'contenttype:event' from the default.aspx site in the Search Center it work fine! But not if you resend the same query in the result.aspx site!

If you go to the webpart setting and save the query as 'fix query" it works with contentType, too.

I have ti investigate, where the difference is.

Marek Czarzbon | Reply

11/25/2010 7:19:53 AM #

Ради Атанасов

Hey Marek,

Thanks for your comments, fellow MCM candidate! Your findings are awesome and definitely call for some further investigation. I will also look into this deeper, but let me know if you find out more info.

Maybe check the logs for the actual query that gets through (it will appear in ULS).

See you soon!

Ради Атанасов | Reply

1/18/2011 1:24:29 PM #

reuma

I encountered the same problem.
To solve it i add new managed property to contentType and then i can use this new property at search WP.

reuma | Reply

3/15/2012 10:53:51 PM #

pingback

Pingback from sladescross.wordpress.com

Retrievable Attribute for Managed Property To Include In Search Query  « Sladescross's Blog

sladescross.wordpress.com | Reply

Add comment


(Will show your Gravatar icon)

biuquote
  • Comment
  • Preview
Loading



Microsoft Certified Master

SharePoint Server MVP

About the author

SharePoint architect, consultant and solution developer.

Аз съм консултант, архитект и разработчик на SharePoint решения.

Feeds

Get RSS Feed (Bulgarian)
Get RSS Feed (English)    
Get RSS Feed  (Both)        

I blog about technical concepts in English, as they benefit the whole community, but sometimes I blog about stuff specific to Bulgaria, and those I post in Bulgarian. The above feed URL's let you choose what to subscribe to.

My SharePoint Forum Activity