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: http://www.example.com/result.aspx?search_type=city&city_name=delhi
For Tags: http://www.example.com/result.aspx?search_type=tag&tag_name=delhi-hotels
For Normal Search: http://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: http://www.example.com/city.aspx?name=delhi
For Tags: http://www.example.com/tag.aspx?name=delhi-hotels
For Normal Search: http://www.example.com/result.aspx?q=delhi+hotels+and+bar&filter=hotlsOnly
For Recent: http://www.example.com/recent.aspx
For Popular: http://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.
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:
So for point 1, as an example, you’ll notice that SO has numberous ways of finding questions, including:
If you take a look at the robots.txt for SO, you’ll see that spiders are not allowed to visit (among other things):
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.