That would work, but the other part of our problem comes in when we then try to facet on the resulting set.. If we filter by size 1, for example, and then facet Width again - we get facet results that have no size 1's, because we have no taught solr what 1_W means, etc etc..

I think field collapsing might solve this for us, maybe..

Thanks for your time!

Matthew Runo
Software Engineer, Zappos.com
mr...@zappos.com - 702-943-7833

On Apr 9, 2009, at 5:23 PM, Chris Hostetter wrote:

: 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


Reply via email to