Summary

You may have a human resources document library where the users would like to search by the “SocialSecurityNumber” column property that was manually populated during the uploading of a document. You could follow these steps to make the “SocialSecurityNumber” SharePoint column “selectable and searchable” from the SharePoint Advanced Search Template.

Below is a summary of the different sections of this article and what the section covers:

Adding Metadata Property Mapping – This step changes the column to a manageable field within SharePoint, if a unless its managed it is not searchable when a crawl is ran. This can be done manually or automatically.

Manually adding Metadata Property Mapping

Automatically adding Metadata Property Mapping

Adding a field to MOSS Advanced Search – This step adds the column name to the dropdown box in the MOSS Advanced Search, there are 2 edits you have to make, the PropertyRef’s tag and the ResultsType ProperyRef tag.

Editing the “PropertyRef” tag

Editing the “ResultTypes” “PropertyRef” tag

Testing – This step covers testing of your changes

Errors – This step covers a couple of known error messages

Adding Metadata Property Mapping

This article will describe how to add the column “test” to the advanced search dropdown box and make it “searchable”. This procedure can be duplicated for any column type.

Set the type, this should be the same type of value as when you created the column

Select “Include values from a single crawled property based on the order specified” and click add mapping. The quickest way is to do a test for the column name. In this case it is ows_Test(Text). This property will not show up unless you have preformed a full or incremental crawl and they need to be populated with data or they will not show up.

Go to “SharePoint” folder, select the drop down menu and select “Edit Category”

Make sure the following three checkboxes are checked off Automatically discover new properties when a crawl takes place

Map all string properties in this category to the Content managed property.

Select “Automatically generate a new managed property for each crawled property discovered in this category”

Press OK (new property will not show up unless you have preformed a full or incremental crawl and they need to be populated with data or they will not show up)

Adding field to MOSS Advanced Search

Go to the MOSS site where you which to perform the search

Select “Advanced Search”. If Advanced Search is unavailable then you have created the site with a template that does not contain a search center. You will need to add a search page to the site from Site Settings >

Select “Edit Page” from the “Site Actions” menu

Select “Modify Shared Web Part” under the “edit” menu

Under the properties of the web part select the “…” link next to properties field under the properties section

Copy all of the content from the popup window into notepad. You will need to edit 2 sections

Editing the “PropertyDef” tag

Look for the section with the “PropertyDefs” tag. Create a new entry as displayed below, make sure it matches the data type you selected when you created the “Metadata Mapping” earlier and also make sure the “name” matches the column name

Editing the “ResultTypes” “PropertyRef” tag

Look the section with the “PropertyRef” tag. There are a couple of different “PropertyRef” sections, make sure to select the one with the property “Display Name=”All Results””. Add a new entry as displayed below. The name should match the column name.

<ResultTypes>

<ResultType DisplayName=”All Results” Name=”default”>

<Query/>

<PropertyRef Name=”Author” />

<PropertyRef Name=”Description” />

<PropertyRef Name=”FileName” />

<PropertyRef Name=”Size” />

<PropertyRef Name=”Path” />

<PropertyRef Name=”Test” />

<PropertyRef Name=”Created” />

<PropertyRef Name=”Write” />

<PropertyRef Name=”CreatedBy” />

<PropertyRef Name=”ModifiedBy” />

</ResultType>

Copy the whole modified XML schema back into the popup window and press OK. Then press Apply then OK on the Advanced Search Box window.

2. Select Publish from the top of the search window

3. You have to perform a full crawl on the site to be able to search one of the custom fields. During testing, we performed an incremental crawl however it did not return any search results until we preformed a full crawl.

Testing

Successful Test

We will attempt to search for the “blue05” metadata under the “test” column. As you can see the document “red05” contains the “blue05” metadata in the “test” column

Searching for blue05 under Test

The search results are successful this returned the “red05” document with the “blue05” metadata under the “test” column.

Unsuccessful Test

Searching for “red05” metadata under the test column. This search should not work because “red05” is under the “title” column and not under the “test” column.

This does not return any results because the column “test” only contains the metadata “blue05”

Errors

Property doesn’t exist or is used in a manner inconsistent with schema settings. – If you do not add the metadata field in search settings or run a crawl after you create the metadata mapping you will get this error.

No results matching your search were found. – If you did not run a full crawl after adding the field to the XML schema, you will get this error.

First of all, thanks for posting the useful info. It is really helpful for new user like me. I did as per your post and I am able to search the custom metadata field and getting the result as well, the only problem is it doesnt show the pdf files

When I did a search on "Damien" it not return the expected results. I have set up others and i though it may be that the crawl only crawls the first part of the column content. I edited the previous column to the following

"Damiens WoodBurns, Damiens Woodburns Retirement Benefits Scheme, "

and the document was retrieved as expected. Obiviously the crawl only indexing the first x characters of the custom property so the burning 64 dollar question is how do I ensure that it crawls the full string