Thats how de-normalization works. You need to update all child products. If you just need the count and you are using facets then maintain a map between category and main product, main product and child product. Lucene db has no schema. You could retrieve the data based on its type.
Category record will have Category name, ProductName and a type (CATEGORY_TYPE) Child product record will have ProductName, MainProductName ProductDetails, and type (PRODUCT_TYPE) Now in this you may need to use two queries. Given the category name, fetch the main product name and query using it to fetch the child products. Hope it helps. Regards Aditya www.findbestopensource.com On Tue, May 22, 2012 at 1:37 PM, Sohail Aboobaker <sabooba...@gmail.com>wrote: > Hi, > > I have a very basic question and hopefully there is a simple answer to > this. We are trying to index a simple product catalog which has a master > product and child products. Each master product can have multiple child > products. A master product can be assigned one or more product categories. > Now, we need to be able to show counts of categories based on number of > child products in each category. We have indexed data using a join and > selecting appropriate values for index from each table. This is basically a > De-normalized result set. It works perfectly for our search purposes. > However, maintaining the index and keeping index up to date is an issue. > Whenever a product master is updated with a new category, we will need to > delete all the index entries for child products in index and insert them > again. This seems a lot of activity for a regular on-going operation i.e. > product category updates. > > Since, join between schemas is only available in 4.0, what are other > strategies to maintain or to create such queries. > > Thanks for your help. > > Regards, > Sohail >