Creating a product list with filtering options

28 views
Skip to first unread message

Sean Rock

unread,
Jul 2, 2014, 6:20:29 AM7/2/14
to rav...@googlegroups.com
Hi

Ok granted the title is a bit vague, let me explain what i'm trying to do.

Currently one of the ecommerce sites we deal with has a product list with filter options, which is quote ubiquitous these days. The filter options include, category, brand (manufacturer) and color. Click on a filter option (lets say a category) will filter the products shown in the list. It will also update the filter options. So in this example, if I select category A, products in category A will be shown and only brands that have products in category A will be visible in the filter list, any others would be removed from the filter options. Also, the number of products for each filter option is displayed/updated next to each visible filter option. More than one option (e.g. brand or category) can be selected.

As an example, please take a look at (this is not the site i'm referring to btw) http://www.asos.com/Men/Accessories/Cat/pgecategory.aspx?cid=4210

As you can see there are filter options on left (style, brand, colour and price range). When you select for example a style (click on belts) you notice that some of the other options are disabled. In our case we hide them so the user doesn't have to scroll the list to see what is available (but that isn't the point, unless they can be excluded somehow).

Currently we are using a combination of database (mssql) and lucene however its cumbersome. Has anyone dealt with this scenario with ravendb? Is it possible (i'm thinking it probably is with map/reduce - but my knowledge and experience with it is limited)? Would it be possible with a single query (I want to reduce the db calls and index queries to optimize performance of this page)?

Thanks
Sean



Hallvar Helleseth

unread,
Jul 2, 2014, 6:28:18 AM7/2/14
to rav...@googlegroups.com
Hi!

What you are referring to is "Facets". The facets you get from RavenDB will not give you the "disabled" values in your  example link. But with some extra code you can in your own code mingle the facets of two queries; one where you get everything and one with the selected filters applied.

RavenDB documentation on faceted search: http://ravendb.net/docs/2.5/client-api/faceted-search

Doing faceted search with RavenDB is by the way very easy and fast!


Kind Regards
Hallvar Helleseth


--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sean Rock

unread,
Jul 2, 2014, 6:31:29 AM7/2/14
to rav...@googlegroups.com
Thanks. I've just stumbled across the same link. I'll have a review - looks promising.

Sean Rock

unread,
Jul 7, 2014, 11:52:16 AM7/7/14
to rav...@googlegroups.com
The example given in the link gives a 404 unfortunately.

Hallvar Helleseth

unread,
Jul 7, 2014, 11:59:41 AM7/7/14
to rav...@googlegroups.com
Do you mean this link gives you a 404?


I suppose it is not really meant to be a real link that you are suppose to click to follow. It is only an example of what the equivalent URI would be for the preceding RavenDB .NET Client example.


Kind Regards
Hallvar Helleseth

Sean Rock

unread,
Jul 8, 2014, 3:22:17 AM7/8/14
to rav...@googlegroups.com
Hi 

No I mean the code in the example, when I run the query that is shown, in my ravendb server console (running from command line) i see it returns a 404 and an exception is thrown.

"The remote server returned an error (404) Not Found"

Sean Rock

unread,
Jul 8, 2014, 3:33:06 AM7/8/14
to rav...@googlegroups.com
Ok, I've got it to work however creating the index in code as shown in the example was the problem. The index wasn't showing in admin which i thought was a bit suspicious. However i created the index manually in the admin and then the query work.

Oren Eini (Ayende Rahien)

unread,
Jul 8, 2014, 3:41:57 AM7/8/14
to ravendb
Great



Oren Eini

CEO


Mobile: + 972-52-548-6969

Office:  + 972-4-622-7811

Fax:      + 972-153-4622-7811



Reply all
Reply to author
Forward
0 new messages