Welcome to TechNet Blogs Sign in | Join | Help

Searching Columns in MOSS using Property Search and Advanced Search

Three basic steps to enable you to search against custom columns in document libraries, lists, … using the Advanced Search property dropdown list, or property search syntax.

   

Step1: Create Custom Column:

If you haven't created the column yet, then go to the document library (I'm assuming a Doc Lib, but anything should be fine)

  • Choose Settings -> Create Column
  • Fill in the Column name, and choose a type for it. I'm going to use "Text" in this case.
  • Click OK to save your changes.

Step 2: Introduce the column to Indexer by creating a "Managed Property":

Indexer crawls contents and retrieves what's called crawled properties. You have to define a managed property and map it to your crawled property definitions (basically columns, in this case). This way, you enable searching against properties you define.

  • Go to Shared Services Administration
  • Go to Search Settings -> Metadata Property Mappings
  • Click on New Managed Property. 
  • Type the property name, and choose its type
  • Click on "Add Mapping"
  • Look for the crawled property name, and click OK. 
  • Now you can see your managed property listed, showing the mapping you did. 
  • Do a Full Crawl, to enable this to be captured as part of the indexing process.
     

Step 3: Show Column in Property Dropdown in Advanced Search:

Last step is more a presentation modification. Here, we're going to modify the "Advanced Search" page, and allow the property dropdown list to show our newly managed property we defined above.
 

  • In the Search Center, click "Advanced Search"
  • Go to Site Actions -> Edit Page
  • In "Advanced Search Box" Click edit -> Modify Shared Web Part
  • Expand Properties, and click to modify the properties XML text.
  • Add two lines as follows:
    • Under <PropertyDefs>, add the following property definition:

      <PropertyDef Name="IndexMe" DataType="text" DisplayName="Index Me!"/>

    • Under <ResultType DisplayName="All Results" …, add a property reference to the property definition just defined

      <PropertyRef Name="IndexMe" />

    • You can do (ii) for other relevant Result Types. 
  • Click OK twice, and check in the advanced search page.


Conclusion:

Now, you can conduct search against you're defined columns, using the advanced search property dropdown. Also, you can conduct property search easily from the search box using the following syntax, which is going to give you the same results:

<some_text_to_search_for> <property_name>:<property_value>
e.g. technical proposal Project:ProjectA

 

Published Tuesday, February 27, 2007 11:15 AM by AQA

Comments

No Comments
Anonymous comments are disabled
 
Page view tracker