• Welcome to KonaKart Community Forum. Please login or sign up.
 

Product Search - Total Results by Category using Solr

Started by grempel, October 25, 2011, 05:27:21 pm

Previous topic - Next topic

grempel

Hi,

I am currently working on a KonaKart installation that uses Solr for search capabilities.

I am looking for a way to produce a table for a given search that displays every category and the number of products in the current search results that belong to each category.

Ie.
All Products (1000)
- Outdoors (500)
- - Sports (250)
- - Gardening (125)
- - Lawn care (125)
- Kitchen (250)
- - Appliances (250)
- Automotive (250)
- - Engine Parts (200)
- - Accessories (50)
- - Other (0)
- Misc (0)

I currently have 2 ways to do this, both of which are terribly inefficient.

Method #1: Return every product in the list (don't use paging/offsets) and manually group product results into categories and count.
Problem: Large lists transmit too much data, subsequent response time is very slow.

Method #2: Rerun the same search query for each category independently and don't return descriptions, and set paging size as small as possible to get the Total Product Count from the result set.
Problem: Search query by itself is efficient, but performing it 30+ times just to return a count takes 20-30 seconds which is very slow.

Is there any way to query konakart with a specific search that can give me a count of the number of results for each category?

Thank you,

Garret

ryan

The latest supported customer release (5.7.5.0) actually includes this feature to allow you to filter your search results. See attached screen shot.

It uses SOLR facets to get facet information for the categories and manufacturers and so is very fast. The categories are sorted by popularity rather than presenting a category tree.

You should also take a look at our Intelligent Suggested Search feature (http://www.konakart.com/konakart/Welcome.do - Top Right Hand Corner) . This list is also sorted by popularity and  for each product we store:

• The category name(s) of the product. i.e. Televisions
• The name of the product manufacturer. i.e. Sony
• The name of the product. i.e. Vaio
• The name of the product model. i.e. VPC-EB42FX
• The name of the category by manufacturer. i.e. Televisions by Sony, Televisions by Philips.
• The name of the manufacturer in a category. i.e. Sony in Televisons, Sony in Computers.

So if in our demo you type in "mi" you'll get, in order of popularity results like:

  • microsoft

  • mice by microsoft

  • microsoft in keyboards