Archive for the ‘SharePoint’ Category

Critical Issue with SharePoint Service Pack 2

Hi Folks. I don’t normally blog about news that lots of others are also covering, but this is too important not to get publicized everywhere possible.

A problem has been discovered with Service Pack 2 for SharePoint Servers (MOSS, Project Server, Forms Server, and Search Server including Express). The service pack inadvertently sets a trial expiration date for the product of 180 days following the installation of the service pack.

If you have your product key handy, you can simply re-enter it in Central Administration to resolve the issue. Otherwise, you will need to wait for Microsoft to release a hotfix. If neither of these options is acceptable, do not install SP2 until a resolution is provided.

This problem does not apply to the Windows SharePoint Services (WSS) only portion of the service pack.

While Search Server Express is affected by this issue, there is no "key" available for the product, so you will need to wait until an official fix is provided.

To get the latest news on this issue, make sure you follow the SharePoint Team Blog, or check this KB article, which should be online shortly (Update: the KB article is now online).

Advertisements

This is the conclusion of a two-part article about customizing the SharePoint (MOSS), and Search Server, Advanced Search Web Part. In Part 1, you learned about the basic settings of the Web Part – which search options are shown, and how they are labeled. In Part 2, I’ll show you how to change which language and document type filters are available to your users.

We completed Part 1 by describing how to configure groups for the Display group option in the "Scopes" section of the settings task pane…

Below the Display group option you will find the options for showing and labeling the language and result type pickers.

image

Checking the checkbox shows the picker, and entering text in the label field replaces the default label text. Just as with the other choices, clearing the text will restore the default label for the selection.

The next group of settings is "Properties", and this is where things start getting a bit more complicated.

image 

Notice that there are only three options:

  • A "Show Properties" checkbox
  • A section label
  • A "Properties" text field.

Just as before, the checkbox and label fields display and label the Properties list. But it is the Properties field which really interests us.

In the small part shown in this text box, you see the beginnings of an XML definition…

image

As they say, "this is just the tip of the iceberg". This XML is actually over 100 lines long! That is because it provides definitions for virtually everything else on the Advanced Search form. If you highlight the field, you will see the "elipsis" button as shown above. Clicking this will summon a larger text editing window:

image

Note: There are no line-breaks in the default XML. They are provided in the following examples for clarity.

There are four primary nodes under the root:

  • LangDefs
  • Languages
  • PropertyDefs
  • ResultTypes

Modifying the Language Filters

LangDefs, or Language Definitions, provides a list mapping all of the languages that SharePoint Search supports, ranging from Arabic to Vietnamese. A typical LangDef sub-node looks like this:

<LangDef DisplayName="Lithuanian" LangID="39" />

The nodes for the default languages are:

<LangDef DisplayName="French" LangID="12" />
<LangDef DisplayName="German" LangID="7" />
<LangDef DisplayName="Japanese" LangID="17" />
<LangDef DisplayName="Spanish" LangID="10" />

The LangID parameter is used in the next section, Languages. The Languages section, by default, lists the four nodes for French, German, Japanese, and Spanish:

<Languages>
  <Language LangRef="12" />
  <Language LangRef="7" />
  <Language LangRef="17" />
  <Language LangRef="10" /> 
</Languages>

The LangRef parameter is the LangID parameter from the LangDefs node of the desired language. To add another language to the list, simply add another Language Node. To remove one, remove the node. The languages are presented in the order listed. Substituting the code for Lithuanian(39) for Japanese(17) in the Languages section gives the following results in the Advanced Search form:

image

Properties and Result Types

Just as LangDefs were used for Languages, the PropertyDefs are used for the ResultTypes. The actual implementation is a bit more complex.

Here is the default PropertyDefs node and its children:

<PropertyDefs>
  <PropertyDef Name="Path" DataType="text" DisplayName="URL" />
  <PropertyDef Name="Size" DataType="integer" DisplayName="Size" />
  <PropertyDef Name="Write" DataType="datetime" DisplayName="Last Modified Date" />
  <PropertyDef Name="FileName" DataType="text" DisplayName="Name" />
  <PropertyDef Name="Description" DataType="text" DisplayName="Description" />
  <PropertyDef Name="Title" DataType="text" DisplayName="Title" />
  <PropertyDef Name="Author" DataType="text" DisplayName="Author" />
  <PropertyDef Name="DocSubject" DataType="text" DisplayName="Subject" />
  <PropertyDef Name="DocKeywords" DataType="text" DisplayName="Keywords" />
  <PropertyDef Name="DocComments" DataType="text" DisplayName="Comments" />
  <PropertyDef Name="Manager" DataType="text" DisplayName="Manager" />
  <PropertyDef Name="Company" DataType="text" DisplayName="Company" />
  <PropertyDef Name="Created" DataType="datetime" DisplayName="Created Date" />
  <PropertyDef Name="CreatedBy" DataType="text" DisplayName="Created By" />
  <PropertyDef Name="ModifiedBy" DataType="text" DisplayName="Last Modified By" /> 
</PropertyDefs>

These represent the standard managed properties used by SharePoint Search. Each PropertyDef provides the actual managed property name, a DisplayName (or Friendly Name) for use in the Property Restrictions dropdown, and the DataType, to allow the UI to provide appropriate comparison prompts. If you define your own managed properties in Search, you will need to manually add each property to this list if you wish your users to be able to choose them in the "Add property  restrictions" section. In addition, you will need to add them to the appropriate ResultTypes.

The ResultTypes node contains the definitions for the items which appear in Result type dropdown:

image

A typical result type definition, for Word documents, is listed below:

<ResultType DisplayName="Word Documents" Name="worddocuments">
  <Query>FileExtension=’doc’ Or FileExtension=’docx’ Or FileExtension=’dot'</Query>
  <PropertyRef Name="Author" />
  <PropertyRef Name="DocComments" />
  <PropertyRef Name="Description" />
  <PropertyRef Name="DocKeywords" />
  <PropertyRef Name="FileName" />
  <PropertyRef Name="Size" />
  <PropertyRef Name="DocSubject" />
  <PropertyRef Name="Path" />
  <PropertyRef Name="Created" />
  <PropertyRef Name="Write" />
  <PropertyRef Name="CreatedBy" />
  <PropertyRef Name="ModifiedBy" />
  <PropertyRef Name="Title" />
  <PropertyRef Name="Manager" />
  <PropertyRef Name="Company" /> 
</ResultType>

You might wonder, "Why are all of these properties listed here, when they were already defined above?"

The answer is simple, not all properties apply to every document type. Something few people have noticed is, when you select a result type, the property restrictions list changes to reflect the properties defined for that result. For example, a Zip file would not have metadata for most document properties. if you have added a Zip iFilter to your search environment, you could add a Result type node for Zip files that looks like this:

<ResultType DisplayName="Zippy Results" Name="zippy">
  <Query>FileExtension=’zip'</Query> 
  <PropertyRef Name="FileName" />
  <PropertyRef Name="Size" />
  <PropertyRef Name="Path" />
  <PropertyRef Name="Created" />
  <PropertyRef Name="Write" />
  <PropertyRef Name="CreatedBy" />
  <PropertyRef Name="ModifiedBy" /> 
</ResultType>

Now, not only can your users search specifically for Zip files, they won’t be confused by being offered the option to search for "Comments" that don’t exist.

The query node isn’t restricted to just file extensions. You can set up a result type with virtually any query supported by the SharePoint Search engine. The "Documents" Result type, for example, simply uses the IsDocument property:

<Query>IsDocument=1</Query>

Summary

This article has given you an overview of the tremendous flexibility of the Advanced Search web part. You have learned about both the easy "checkbox" options and the not so straight-forward XML configuration file. You can now tailor Advanced Search to the specific languages, documents, and custom properties used in your environment.