views:

156

answers:

4

I am developing a web application, in which I have the following type of search functionality;

  • Normal search: where user will enter the search keyword to search the records.
  • Popular: this is no a kind of search, it will display the popular records on the website, something as digg and other social bookmarking sites does.
  • Recent: In this I am displaying Recently added records in my website.
  • City Search: Here I am presenting city names to the user like "Delhi", "Mumbai" etc and when user click this link then all records from that particular city will be displayed.
  • Tag Search: Same as city search I have tag links, when user will click on a tag then all records marked with that tag will be displayed to the user.
  • Alphabet Search: Same as city and tag this functionality also has links of letters like "A", "B", .... etc and when user clicks on any letter link then all records starting with that particular letter will be displayed to the user

Now, my problem is I have to provide above listed searches to the user, but I am not able to decide that I'll go with one page (result.aspx) which will display all the searches records, and I'll figure using query string that which search is user is using and what data I have to display to the user. Such as, lets say I am searching for city, delhi and tag delhi-hotels then the urls for both will be as :

For City: www.example.com/result.aspx?search_type=city&city_name=delhi

For Tags: www.example.com/result.aspx?search_type=tag&tag_name=delhi-hotels

For Normal Search: www.example.com/result.aspx?search_type=normal&q=delhi+hotels+and+bar&filter=hotlsOnly

Now, I feels above Idea of using a single page for all searches is messy. So I thought of some more and cleaner Idea, which is using separate pages for all type of searches as

For City: www.example.com/city.aspx?name=delhi

For Tags: www.example.com/tag.aspx?name=delhi-hotels

For Normal Search: www.example.com/result.aspx?q=delhi+hotels+and+bar&filter=hotlsOnly

For Recent: www.example.com/recent.aspx

For Popular: www.example.com/popular.aspx

My new idea is cleaner and it tells specifically everything to the user that which page is for what, it also gives him idea that where he is now, what records he's seeing now. But the new idea has one problem, In case I have to change anything in my search result display then I have to make changes in all pages one by one, I thought that solution for this problem too, which is using user-control under repeater control, I'll pass all my values one by one to user-control for rendering HTML for each record.

Everything is fine with new Idea, But I am still no able to decide that with which I dea I have to go for, Can anyone tell me your thoughts on this problem.

I want to implement an idea which will be easy to maintain, SEO friendly (give good ranking to my website), user-friendly(easy to use and understand for the users)

Thanks.

A: 

I would stick with the original result.aspx result page. My reasoning for this from a user point of view is that the actual URL itself communicates little information. You would be better off creating visual cues on the page that states stuff like "Search for X in Category Y with Tags Z".

As for coding and maintenance, since everything is so similar besides the category it would be wise to just keep it in one tight little package. Breaking it out as you proposed with your second idea just complicates something that doesn't need to be complicated.

bojo
A: 

Ditch the querystrings and use URL rewriting to handle your "sections".. much better SEO and clearer from a bookmark/user readability standpoint.

City: www.example.com/city/delhi/

Tag: www.example.com/tag/delhi-hotels/

Recent: www.example.com/recent/

Popular: www.example.com/popular/

Regular search can just go to www.example.com/search.aspx or something.

Nicholas H
Prashant
Any solution, HTTPModule which will do this for me ???
Prashant
Check out http://urlrewriter.net/
Nicholas H
The Routing module that comes with ASP.NET MVC can also be used on a non-MVC site: ScottGu mentions this here: http://bit.ly/1tl4w
Zhaph - Ben Duguid
+1  A: 

There are a few issues that need to be addressed to properly answer your question:

  1. You do not necessarily need to redirect to the Result page before being able to process the data. The page or control that contains the search interface on submitting could process the submitted search parameters (and type of search) and initiate a call to the database or intermediary webservice that supplies the search result. You could then use a single Results page to display the retrieved data.

  2. If you must pass the submitted search parameters via querystring to the result page, then you would be much better off using a single Result page which parses these parameters and displays the result conditionally.

  3. Most users do not rely on the url/querystring information in the browser's address bar to identify their current location in a website. You should have something more visually indicative (such as a Breadcrumbs control or header labels) to indicate current location. Also, as you mentioned, the maintainability issue is quite significant here.

I would definitely not recommend the second option (using separate result pages for each kind of search). If you are concerned about SEO, use URL rewriting to construct URL "slugs" to create more intuitive paths.

Cerebrus
On Point 3 - Users may rely on the URL/QS information to bookmark a set of results/query - having the query details in the qs makes this a possibility, doing it through a post back would lose this feature.
Zhaph - Ben Duguid
You are right, but this is a rare case where users would repeatedly search using the same parameters... repeatedly enough to want to bookmark the address.
Cerebrus
+1  A: 

One thing to mention on the SEO front:

As a lot of the "results" pages will be linking through to the same content, there are a couple of advantages to appearing* to have different URLs for these pages:

  1. Some search engines get cross if you appear to have duplicate content on the site, or if there's the possiblity for almost infinite lists.
  2. Analysing traffic flow.

So for point 1, as an example, you'll notice that SO has numberous ways of finding questions, including:

  1. On the home page
  2. Through /questions
  3. Through /tags
  4. Through /unanswered
  5. Through /feeds
  6. Through /search

If you take a look at the robots.txt for SO, you'll see that spiders are not allowed to visit (among other things):

Disallow: /tags
Disallow: /unanswered
Disallow: /search
Disallow: /feeds
Disallow: /questions/tagged

So the search engine should only find one route to the content rather than three or four.

Having them all go through the same page doesn't allow you to filter like this. Ideally you want the search engine to index the list of Cities and Tags, but you only need it to index the actual details once - say from the A to Z list.

For point 2, when analysing your site traffic, it will be a lot easier to see how people are using your site if the URLs are meaningful, and the results aren't hidden in the form header - many decent stats packages allow you to report on query string values, or if you have "nice" urls, this is even easier. Having this sort of information will also make selling advertising easier if that's what's you're interested in.

Finally, as I mentioned in the comments to other responses, users may well want to bookmark a particular search - having the query baked into the URL one way or another (query strings or rewritten url) is the simiplist way to allow this.

*I say "appearing" because as others have pointed out, URL rewriting would enable this without actually having different pages on the server.

Zhaph - Ben Duguid
Hi, thanks for detailed explaination, few points I want to ask. 1. Is SO maintaining all its searches from a single pages (by routing them according to request) ?
Prashant
2. As in my site, I want to index my cities and tag pages, because I want people will be able to get the specific cities result in search engines, so that they can directly get what they want? (Please tell me I am right or not??)
Prashant
And finally what you think which Idea will be better according to my conditions, different URL pages, or single URL pages?
Prashant
Please note: that I am on shared hosting so, will not able to implement URL-rewriting, so I have to go with .aspx pages (tag.aspx, city.aspx, popular.aspx recent.aspx), So, I must have to go with .aspx pages :(
Prashant