This article discusses the custom implementation of a faceted search web part that uses the MOSS Full Text SQL Query API.
Issues and Solutions with Multi-valued Managed Properties
During development, issues were encountered when querying certain multi-valued Managed Properties, specifically Skills and Interests. The CONTAINS predicate was used in the query, which works only against managed properties that have been enabled as FullTextQueriable.
Enabling FullTextQueriable Managed Properties
Since there is no direct way to enable a property in the SSP Search Settings, this needs to be done using the API. This led to the creation of a specific method as part of a Web Application scoped Feature Receiver to ensure certain Managed Properties were ‘FullTextQueriable’:
“`csharp
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);
}
}
}
“`
Retrievable Flag for Managed Properties
Another flag, Retrievable, prevents a Managed Property’s value from being returned if specified as a column in the SELECT statement. The default FullTextQueriable, HasMultipleValues, and Retrievable flag values for most out-of-the-box Managed Properties can be found in the source information provided.
Conclusion
The custom implementation of a faceted search web part in MOSS is a powerful tool for querying data, especially when dealing with multi-valued Managed Properties. Utilizing the Full Text SQL Query API and customizing Managed Properties using the API allows for a more effective and efficient search process.