views:

38

answers:

1

Searching with mutltiple Parameters

In my app I would like to allow the user to do complex searches based on several parameters, using a simple syntax similar to the GMail functionality when a user can search for "in:inbox is:unread" etc.

However, GMail does a POST with this information and I would like the form to be a GET so that the information is in the URL of the search results page.

Therefore I need the parameters to be formatted in the URL.

Requirements:

  • Keep the URL as clean as possible
  • Avoid the use of invalid URL chars such as square brackets
  • Allow lots of search functionality
  • Have the ability to add more functions later.

I know StackOverflow allows the user to search by multiple tags in this way:

However, I'd like to also allow users to search with multiple additional parameters.

Initial Design

My design is currently to do use URLs such as these:

I intend to parse the URL after the search parameter, then decide how to construct my search query.

Has anyone seen URL parameters like this implemented well on a website?

If so, which do it best?

+1  A: 

What you have here isn't a bad start.

Some things to keep in mind is that there is a length restriction on urls ~2000 characters in IE. Keep this in mind in the battle between SEO and readability vs brevity.

I'm not aware of any standards in this arena outside of common sense which it appears you've captured.

Another thing to keep in mind is that most search engines use standard url params e.g. ?http://www.google.com/search?hl=en&source=hp&q=donkeys+for+sale&aq=f&aqi=g10&aql=&oq=&gs_rfai= There is good reason for this namely to do with url encoding and allowing for not traditional characters in the search bar.

So while pretty urls are nice they fail here for a variety of reasons

Phil Strong