views:

50

answers:

2

Please check http://www.alibaba.com/catalogs/cid/702/Laptops.html they have nice filter here with number of items for each. Note one detail - they have locations here. Same thing on olx.com - location and number of items for each category.

Now imagine I have tables: [products] (Id, Name, CategoryId, LocationId) [Categories] (Id,Name) [Location] (Id, Name)

My question how can I do the same, cause count things even with caching looks expensive? And they give results pretty fast...

Please advice with possible ways to do that in ASP.NET, C#, MVC, MS SQL, but avoice simple answers like "count and change" Thank you in advance.

+1  A: 

I would go with ASP.NET MVC for server side and Jquery for client side , for your requirement.

This combination allows you to have full control over the UI , and manipulate them using Javascript.

Some of the complex controls rendered by ASP.NET has its 'id' value dynamically generated which might be an issue.

As for your requirement http://www.alibaba.com/catalogs/cid/702/Laptops.html

There are good number of Jquery plugins that you can take advantage of to render the visual effects.

Please check out the link below (Table Sorter plugin) which i found useful for adding display effects to tables in particular.

Table Sorter

Hope this helps.

Thanks , Vijay

vijaysylvester
Vijay,Thank you for your answer and especial thank you for a url. OK, with JQuery I'll be able to do client side, it's all right and I can't see alternatives.... but how to handle data. Please check my comment to Mohang, here the problem.
dreamer
@dreamer , The beauty of the TableSorter plugin is , it doesnt hit the server each time the filter selection is made . Displaying the filtered candidates takes place in the client side , Which wont be an performance hit! Thanks.
vijaysylvester
A: 

They are showing the possible filters at level one. When you choose a filter, they are running the search with that filter and fetching narrowed filters. The key is running the filters each time. This is quite achievable. I have done this already in asp.net MVC. In your case, it would be even easier as you do not have many filters.

Decide the level-1 filters. For each level-1 filters, decide which are the level-2 filters. Decide what is the meanigful depth levels for each filter type.

As the user keeps adding filters, run the filters that user has selected or unselected so for. you get the items after applying the filters. Show them according to the level of filters.

mohang
Mohang,Thank you for your answer. What is unclear for me it's: I have NN locations.. and NN categories.. both of them are "level 1" filters..fine.. question is HOW do they calculate number of items in each location and category. How? If you tried run COUNT or GROUP BY in 15 million records database you will understand my "point of confusion" :) its takes more than 2 seconds, I think.. but to serve such number of statistic info you need run at least 5 or 10 counters at level 1 for each location.
dreamer