Developer forum

Forum » Ecommerce - Standard features » Using new index from code?

Using new index from code?

Peter Leleulya
Reply

Hi guys,

I'm having a struggle with an external cross-reference table:

 

In my dynamicweb website I have a filter page.

The filter works by pull-downs and on each select the next pulldown is filled to narrow the search.

This search is done with generic handlers on a table in an external database (specific requirement of the customer).

 

These selections result in a list of (non dynamicweb) objects.

These objects have some parameters that correspond to custom product fields of the products in the Dynamicweb database.

Now, for each result in my list of objects I need to get all dynamicweb product of which the value of a certain parameter matches the value of a dynamicweb product custom field.

 

This should eventualy result into a productlist with orderable dynamicweb products (not neceseraly an ecom module, i could create a custom list with add to cart funcitonality), enriched with data from the cross reference list (or vice versa).

 

I created a product index, but I can't figure out how to access this from code in a way I can do some querying.

I don't want to have the full product result and filter on that, because we're talking abount 200.000+ products and the filtering should change on-the-fly.

Just a json feed of the full productlist using a query on the index for example takes forever to present, so I need another way.

Does anybody have an idea how to approach this and end up with an efficient filtering system?


Replies

 
Nicolai Høeg Pedersen
Reply

Hi Peter

I think using the product catalog published with a lucene search in JSON format would be a good option. You can easily search against your index, change the search, have the parameter values come from your custom code, it supports paging, handles all the pricing issues etc.

You can see an example of this on wrap:

http://wrap.dynamicweb-cms.com/Default.aspx?ID=8413&pagesize=10&q=bike&pagenum=1
http://wrap.dynamicweb-cms.com/Default.aspx?ID=8413&pagesize=10&q=bike&pagenum=2

This should also work for large indexes - as long as your search is fast (and Lucene is fast if used correctly), this json feed will also be fast.

BR Nicolai

 

 

You must be logged in to post in the forum