: Right now a document looks like this: : : <doc> : <!-- style level --> : <productID>1598548</productID> : <styleID>12545</styleID> : <brand>Adidas</brand> : <size>1, 2, 3, 4, 5, 6, 7</size> : <width>AA, A, B, W, W, WWWW</width> : <color>Brown</color> : </doc> : : If we went down a level, it could look like.. : <doc> : <!-- stock level --> : <productID>1598548</productID> : <styleID>12545</styleID> : <stockID>654641654684</stockID> : <brand>Adidas</brand> : <size>1</size> : <width>AA</width> : <color>Brown</color> : </doc>
If you want result at the "product" level then you don't have to have one *doc* per legal size+width pair ... you just need one *term* per valid size+width pair.... <size>1, 2, 3, 4, 5, 6, 7</size> <width>AA, A, B, W, W, WWWW</width> <opts>1_W 2W 3_B 3_W 4_AA 4_A 4_B 4_W 4_WW 5_W 5_WWWW 6_WWWW 7_WWWW</opts> a search for size 4 clogs would look like... q=clogs&fq=size:5&facet.field=opts&f.opts.facet.prefix=4_ ...and the facet counts for "opts" would tell me what widths were available (and how many). for completeness you typically want to index the pairs in both directions (1_W and W_1 ... typically in seperate fields) so the user can filter by either option first ... for something like size+color this makes sense, but i'm guessing with shoes no one expects to narrow by "width" untill they've narrowed by size first. -Hoss