First rule is: denormalize when possible. Just store a separate document with each combination of attributes: if the Reebok HF comes in red and blue, store two documents: Reebok HF,red Reebok HF,blue
Then, use grouping and facets to decide what to show. "Category is heierarchical": Pivot facets, facet.pivot=field1,field2,field3 gives a tree-structured list of all documents with shared values of this&that facet. "More than one category can share the same name.": In your database you should have a unique key for every variation of this problem: even if 5 keys show as "Reebok HF", that is ok. You know internally exactly what these are, even if they show the same text string. To search on these strings from clicking on a facet, you need a way to combine a string to show in the browser with the unique search key. One way is to add the display string to the key in javascript encoding: the UI strips off the key and shows the display string, but sends the entire key in with a search. On Mon, Sep 5, 2011 at 1:34 AM, Ranveer <ranveer.s...@gmail.com> wrote: > Hi Priti, > > You can do this by adding an extra field (string type) for facet on which > you need to send query. > > > 1.One product can belong to more than one categories. > > You can put internal flag for that category at index time, and at the time > of query you can send that flag to query. > > More of less same thing I am doing in www.jagranjosh.com and > videos.jagran.com > > regards > Ranveer > > > > > On Monday 05 Septyember 2011 01:09 PM, Tony Qiu wrote: > >> Dear Gupta, >> >> In my case, I am doing something similar to you. >> I use tow core, one core I build category's tree, another core I use to >> build the product's information include the leaf cat of products. So when >> one search I get, I will facet the leaf cat, then get the category tree in >> the category core via product's leafcat (or you can cache the category >> tree >> in you memery). >> >> Hope this can help u. >> >> 2011/9/5 Priti Gupta<pgupt...@sapient.com> >> >> Hi, >>> >>> We are using solr in our ecommerce application.we are indexing on >>> different >>> attributes of products. >>> We want to create category tree with the help of solr. >>> >>> There are following points about catgory and products to be considered, >>> 1.One product can belong to more than one categories. >>> 2.category is a hierarchical facet. >>> 3.More than one categories can share same name. >>> >>> It would be a great help if someone can suggest a way to index and query >>> data based on the above architecture. >>> >>> Thanks, >>> Priti >>> >>> > -- Lance Norskog goks...@gmail.com