Bookmark and Share Subscribe Bookmark and Share

Categories

Advertisement



Adding a custom search result Column (metadata) to MOSS Advanced Search

Sep
07

 « »    

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.

Manually adding Metadata Property Mapping

 

  1. Go to Central Administrator
  2. Go to Shared Service Provider Administrator (http://CENTRALADMINURL/ssp/admin)
  3. Select “Search Settings” from the option in the search menu
  4. Select “Metadata Property Mappings”
  5. Select “New Managed Property” (Figure 1.1)
    1. Type in the property name, this should match the column name
    2. Set the type, this should be the same type of value as when you created the column
    3. 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.
    4. Select “Allow this property to be used in scopes”
    5. Click OK

Figure 1.1 New Managed Property window

Automatically adding Metadata Property Mapping

 

  1. Go to Central Administrator
  2. Go to Shared Service Provider Administrator (http://CENTRALADMINURL/ssp/admin)
  3. Select “Search Settings” from the option in the search menu
  4. Select “Metadata property mappings”
  5. Select “Crawled Properties” from the menu on the left
  6. Go to “SharePoint” folder, select the drop down menu and select “Edit Category”
    1. Make sure the following three checkboxes are checked off Automatically discover new properties when a crawl takes place
    2. Map all string properties in this category to the Content managed property.
    3. Select “Automatically generate a new managed property for each crawled property discovered in this category”
  7. 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

  1. Go to the MOSS site where you which to perform the search
  2. 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 >
  3. Select “Edit Page” from the “Site Actions” menu

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

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

  1. 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

<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=”Test” DataType=”text” DisplayName=”Test”/>

<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>

 

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>

  1. 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

  1. 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.
  2. 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.

 

 

 

 

 

 




    Did I save you time and headaches? Buy me a cup of coffee.
    The more coffee I drink the more articles I can write.




5 Comments so far

  1. What are crawl property name for Date created and date modified property of list library items…the default one . I am not able to fetch that using xslt . If any hint?

  2. Hi

    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

    any clue?

    thanks

    bhum

    • ova ceren said:
    • Posted on March 10th, 2010 at 11:56 pm
    • Reply
    • Permalink

    Hi,

    is there a way to add the managed properties to default search dropdown?

    • Damien McCartney said:
    • Posted on October 14th, 2009 at 2:33 am
    • Reply
    • Permalink

    I have a custom column which I populate with a series of metadata, the custom column has been sized t0 255.

    Now I have added the custom type to be crawled within the crawled custom metadata property with the Search SSP.

    The column contains the following:

    "Bloggs and Partners, Bombay, Administration, General Correspondence, Damiens WoodBurns, Damiens Woodburns Retirement Benefits Scheme, "

    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

    Many Thanks

    D

Leave a comment

Trackbacks on this post

  1. Adding a custom search result column (METADATA) to MOSS Advanced Search | Its all about SharePoint!

    […] see the original article on JPPinto.com for more […]