Hello Kelly,
I am not entirely sure if i understand your problem correctly. But i believe your first approach is the right one. Your question: "Which products are available that contain skus with color Green, size M, and a price of $9.99 or less?" can be easily answered using a schema like yours. id = 1 color = [green, blue] size = [M, S] price = 6 id = 2 color = [red, blue] size = [L, S] price = 12 id = 3 color = [green, red, blue] size = [L, S, M] price = 5 Using the data above you can answer your question using a basic Solr query [1] like the following: q=color:green AND price:[0 TO 9,99] AND size:M Of course, you would make this a function query [2] but this, if i understood your question well enough, answers it. [1] http://wiki.apache.org/solr/SolrQuerySyntax [2] http://wiki.apache.org/solr/FunctionQuery Cheers, Kelly Taylor zei: > > I am in the process of building a Solr search solution for my > application and have run into a roadblock with the schema design. > Trying to match criteria in one multi-valued field with corresponding > criteria in another > multi-valued field. Any advice would be greatly appreciated. > > BACKGROUND: > My RDBMS data model is such that for every one of my "Product" entities, > there are one-to-many "SKU" entities available for purchase. Each SKU > entity can have its own price, as well as one-to-many options, etc. The > web frontend displays available "Product" entities on both directory and > detail pages. > > In order to take advantage of Solr's facet count, paging, and sorting > functionality, I decided to base the Solr schema on "Product" documents; > so none of my documents currently contain duplicate "Product" data, and > all "SKU" related data is denormalized as necessary, but into > multi-valued fields. For example, I have a document with an "id" field > set to > "Product:7," a "docType" field is set to "Product" as well as > multi-valued "SKU" related fields and data like, "sku_color" {Red | > Green | Blue}, "sku_size" {Small | Medium | Large}, "sku_price" {10.00 | > 10.00 | 7.99} > > I hit the roadblock when I tried to answer the question, "Which products > are available that contain skus with color Green, size M, and a price of > $9.99 or less?"...and have now begun the switch to "SKU" level indexing. > This also gives me what I need for faceted browsing/navigation, and > search refinement...leading the user to "Product" entities having > purchasable "SKU" entities. But this also means I now have documents > which are mostly duplicates for each "Product," and all, facet counts, > paging and sorting is then inaccurate; so it appears I need do this > myself, with multiple Solr requests. > > Is this really the best approach; and if so, should I use the Solr > Deduplication update processor when indexing and querying? > > Thanks in advance, > Kelly > -- > View this message in context: > http://old.nabble.com/Encountering-a-roadblock-with-my-Solr-schema-design...use-dedupe--tp27118977p27118977.html > Sent from the Solr - User mailing list archive at Nabble.com.