in

SharePoint Blogs

The Best Place for SharePoint-related Blogs

John Ross

Ross On MOSS

Custom Advanced Search: Building a URL to search multiple metadata properties

A few days ago in my post called "Creating a custom advanced search by building strings with JavaScript" I talked about how you could use the Content Editor Web Part (CEWP) to build strings that would allow you provide a user friendly way to leverage the advanced search capabilities in MOSS.

To take the concept one step further, what if you created multiple HTML fields in your CEWP and wanted to allow users to be able to type in values in each field to refine the searching experience.  For example you could have two boxes like Car and Color.  A user could type in Blue and Ford and get only the values that matched both metadata properties. All you'd need to do is figure out what your search query would need to look like.  To test you'd need to type a query in this format:

Property1:"Value1" Property2:"Value2"

This would produce a URL that looked something like this:

myResults.aspx?k=Property1%3A%22Value1%22%20poArea%3A%22Value2%22

All you'd need to do is just use some JavaScript to build a string in a similar format.  If you really wanted to get fancy, you could build some smarts into your JavaScript function to allow users to enter data into some or all of the fields and have it check if the field is blank to not use that value in the string.

 -JR

 

Published Apr 04 2008, 10:37 AM by RossOnMoss
Filed under: ,

Comments

No Comments

Leave a Comment

(required )  
(optional )
(required )  
Add

Need SharePoint Training? Attend a SharePoint Bootcamp!

Posts (c) their respective authors. Everything else (c) 2007 SharePoint Experts