I just wrapped up a custom implementation of a faceted search web part that uses the MOSS Full Text Sql Query API. During the development, I ran into issues querying certain multi-valued Managed Properties, specifically Skills and Interests. In my query, I was using the CONTAINS predicate like such:
SELECT UserProfile_GUID, PreferredName, JobTitle, Department, WorkPhone, OfficeNumber, AboutMe, PictureURL, WorkEmail, WebSite, Path, HitHighlightedSummary, HitHighlightedProperties, Responsibility, Skills, SipAddress FROM scope() WHERE freetext(defaultproperties,'+trent') AND ("scope" = 'People') AND CONTAINS(Skills, '"numchucks"') AND CONTAINS(Skills, '"rockstar"')
Use of the CONTAINS predicate was purely due to my need to query multi-valued properties. If you are not querying a multi-valued property, you may simply use the ‘=’ or ‘LIKE’ predicates.
It turns out that the CONTAINS predicate will only work against managed properties that have been enabled as FullTextQueriable. I am not aware of a way to enable a property in the SSP Search Settings, so this has to be done using the API. I ended up including the following method as part of a Web Application scoped Feature Receiver to ensure certain Managed Properties were ‘FullTextQueriable’.
using Microsoft.Office.Server; using Microsoft.Office.Server.Search.Administration; private void EnsureFullTextQueriableManagedProperties(ServerContext serverContext, params string[] managedPropertyNames) { var schema = new Schema(SearchContext.GetContext(serverContext)); foreach (ManagedProperty managedProperty in schema.AllManagedProperties) { if (!managedPropertyNames.Contains(managedProperty.Name)) continue; if (managedProperty.FullTextQueriable) continue; try { managedProperty.FullTextQueriable = true; managedProperty.Update(); Log.Info(m => m("Successfully set managed property {0} to be FullTextQueriable", managedProperty.Name)); } catch (Exception e) { Log.Error(m => m("Error updating managed property {0}", managedProperty.Name), e); } } }
So on the same note of Managed Property flags not visible in the SSP Search Settings, you may also want to know about the Retrievable flag. This flag prevents a Managed Property’s value from being returned if specified as a column in the SELECT statement.
The following table lists most of the out of the box Managed Properties and their default FullTextQueriable, HasMultipleValues, and Retrievable flag values.
| Name | FullTextQueriable | HasMultipleValues | Retrievable |
|---|---|---|---|
| AboutMe | ![]() |
||
| Account | ![]() |
![]() |
|
| AccountName | ![]() |
||
| AssignedTo | ![]() |
![]() |
|
| Assistant | ![]() |
||
| Author | ![]() |
![]() |
|
| Authority | ![]() |
||
| BestBetKeywords | ![]() |
![]() |
![]() |
| Birthday | ![]() |
||
| CachedPath | ![]() |
||
| CategoryNavigationUrl | ![]() |
![]() |
|
| CollapsingStatus | ![]() |
||
| Company | ![]() |
||
| contentclass | ![]() |
![]() |
|
| ContentSource | ![]() |
||
| ContentType | ![]() |
![]() |
|
| Created | ![]() |
||
| CreatedBy | ![]() |
![]() |
|
| DataSource | ![]() |
||
| DatePictureTaken | ![]() |
||
| Department | ![]() |
||
| Description | ![]() |
![]() |
|
| DisplayTitle | ![]() |
||
| DocComments | ![]() |
![]() |
|
| DocKeywords | ![]() |
![]() |
![]() |
| DocSignature | ![]() |
||
| DocSubject | ![]() |
![]() |
|
| DottedLine | ![]() |
||
![]() |
![]() |
||
| EndDate | ![]() |
||
| Fax | ![]() |
||
| FileExtension | ![]() |
||
| Filename | ![]() |
![]() |
|
| FirstName | ![]() |
![]() |
|
| FollowAllAnchor | ![]() |
||
| HighConfidenceDisplayProperty1 | ![]() |
||
| HighConfidenceDisplayProperty10 | ![]() |
||
| HighConfidenceDisplayProperty11 | ![]() |
||
| HighConfidenceDisplayProperty12 | ![]() |
||
| HighConfidenceDisplayProperty13 | ![]() |
||
| HighConfidenceDisplayProperty14 | ![]() |
||
| HighConfidenceDisplayProperty15 | ![]() |
||
| HighConfidenceDisplayProperty2 | ![]() |
||
| HighConfidenceDisplayProperty3 | ![]() |
||
| HighConfidenceDisplayProperty4 | ![]() |
||
| HighConfidenceDisplayProperty5 | ![]() |
||
| HighConfidenceDisplayProperty6 | ![]() |
||
| HighConfidenceDisplayProperty7 | ![]() |
||
| HighConfidenceDisplayProperty8 | ![]() |
||
| HighConfidenceDisplayProperty9 | ![]() |
||
| HighConfidenceImageURL | ![]() |
||
| HighConfidenceMatching | ![]() |
![]() |
|
| HighConfidenceResultType | ![]() |
||
| HireDate | ![]() |
||
| HitHighlightedProperties | ![]() |
||
| HitHighlightedSummary | ![]() |
||
| HomePhone | ![]() |
||
| Interests | ![]() |
![]() |
|
| IsDocument | ![]() |
||
| JobTitle | ![]() |
||
| Keywords | ![]() |
![]() |
|
| LastModifiedTime | ![]() |
||
| LastName | ![]() |
![]() |
|
| Location | ![]() |
||
| Manager | ![]() |
||
| MemberOf | ![]() |
||
| Memberships | ![]() |
![]() |
![]() |
| MobilePhone | ![]() |
||
| ModifiedBy | ![]() |
![]() |
|
| MySiteWizard | ![]() |
||
| NLCodePage | |||
| Notes | ![]() |
![]() |
|
| objectid | ![]() |
||
| OfficeNumber | ![]() |
||
| OWS_URL | ![]() |
||
| PastProjects | ![]() |
![]() |
|
| Path | ![]() |
![]() |
|
| Peers | ![]() |
![]() |
|
| PersonalSpace | ![]() |
||
| PictureHeight | ![]() |
![]() |
|
| PictureSize | ![]() |
![]() |
|
| PictureThumbnailURL | ![]() |
||
| PictureURL | ![]() |
||
| PictureWidth | ![]() |
![]() |
|
| PreferredName | ![]() |
||
| Priority | ![]() |
![]() |
|
| ProxyAddresses | ![]() |
||
| PublicSiteRedirect | ![]() |
||
| Purpose | ![]() |
![]() |
|
| Rank | ![]() |
||
| RankDetail | ![]() |
||
| Responsibilities | ![]() |
![]() |
|
| Schools | ![]() |
![]() |
|
| SID | ![]() |
||
| SipAddress | ![]() |
||
| Site | |||
| SiteName | ![]() |
||
| SiteTitle | ![]() |
||
| Size | ![]() |
||
| Skills | ![]() |
![]() |
|
| StartDate | ![]() |
||
| Status | ![]() |
![]() |
|
| Title | ![]() |
![]() |
|
| UrlDepth | ![]() |
||
| UserName | ![]() |
||
| UserProfile_GUID | ![]() |
||
| WebId | ![]() |
||
| WebSite | ![]() |
||
| WorkAddress | ![]() |
![]() |
|
| WorkCity | ![]() |
![]() |
|
| WorkCountry | ![]() |
![]() |
|
| WorkEmail | ![]() |
||
| WorkId | ![]() |
||
| WorkPhone | ![]() |
||
| WorkState | ![]() |
![]() |
|
| WorkZip | ![]() |
![]() |

Recent Comments