Hi O.O.,

You don't need to add them all into the schema.  You can use the wildcard 
fields like <dynamicField name="*_s"  type="string"  indexed="true"  
stored="true" /> to hold them.  You can then have the attribute name be the 
part of the wildcard and the attribute value be the field contents. So you 
could have fields like Function_s:Scanner etc and then you could ask for facets 
which are relevant based upon query or category.

That would be a much more straightforward approach and much easier to facet on. 
 Hope that helps a little bit.

-Robi


-----Original Message-----
From: O. Olson [mailto:olson_...@yahoo.it] 
Sent: Monday, January 28, 2013 1:42 PM
To: solr-user@lucene.apache.org
Subject: Solr Faceting with Name Values

Hi,

        We are looking at putting our Product Catalog into Solr. Our Product 
Catalog involves a Product, and a number of [Name, Value] pairs – which 
represent attributes of a particular product. The attribute names are standard 
along a certain Product Category, but they are too numerous to put into the 
schema. I would like to add faceting queries on these attributes. 

For e.g. 

Product 1: 
Name: Cannon Scanner
Category: Office Machines
Attribute 1 Name: Function
Attribute 1 Value: Scanner
Attribute 2 Name: PC Connection
Attribute 2 Value: USB
Attribute 3 Name: Scan Speed (ppm)
Attribute 3 Value: 2

Product 2: 
Name: HP Printer
Category: Office Machines
Attribute 1 Name: Function
Attribute 1 Value: Printer
Attribute 2 Name: PC Connection
Attribute 2 Value: LAN
Attribute 3 Name: Print Speed (ppm)
Attribute 3 Value: 35

I would like to know if there would be an easy way to retrieve the Facet Counts 
related to “PC Connection”. I think this should give me the counts for LAN, 
USB, Wi-Fi etc. for the way products connect to a PC. 

If I would put “PC Connection” into a separate field in the schema in Solr, I 
can append something like the following to the end of my query:

&facet=true&facet.field=PC+Connection

However, there are too many attribute names like “PC Connection”. Is there any 
way to get the facet counts without putting “PC Connection” into a separate 
field? How should I structure my schema to get these results?


Thank you all for your help.
O. O.




--
View this message in context: 
http://lucene.472066.n3.nabble.com/Solr-Faceting-with-Name-Values-tp4036872.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to