Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am working on adding facets to my Solr queries and I am getting some odd results.

Let's say that I have a list of manufacturers that I want to have faceted. This list would include:

Port Authority
Carhartt Clothing
Dickies Uniforms

My facets for this come back as:

<int name="port">157</int>
<int name="authority">156</int>
<int name="clothing">156</int>
<int name="carhartt">105</int>
<int name="uniforms">67</int>
<int name="dickies">58</int>

Is there a way to make the facets use the full value, not split on each word? I have defined manufactuer in my schema.xml file as:

<field name="manufacturer" type="text_general" indexed="true" stored="true" multiValued="false"/>

I largely have the default schema.xml file that is in the example directory when you download Solr. The only thing I changed from the default example was add my fields.

share|improve this question
    
Have you tried this question on Stack Overflow? It seems like something that might get a better response there. –  pjmorse Jan 4 '13 at 16:51
    
@pjmorse meta.stackexchange.com/a/161487/155556 –  Neal Jan 4 '13 at 17:58
    
Nice! To be clear, I don't think the question doesn't belong here; this is definitely a gray area from my POV. I suggested SO because when in doubt there are just more eyes there. I'll follow up on the meta thread. –  pjmorse Jan 4 '13 at 18:52

1 Answer 1

up vote 1 down vote accepted
+50

One easy way to do that is copy you data to a specific facet field. You usually don't want tokenization or any other changes to you facet field.

For example, at you solr schema.xml you can do

<copyField source="manufacturer" dest="manufacturerFacet"/>

This will copy the data you try to store at the manufacturer field to the manufacturerFacet automatically. This way you can set manufacturerFacet field as the following using string as base standard type with no tokenization.

<field name="manufacturerFacet" type="string" indexed="true" stored="false" multiValued="true"/>
<fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/>
share|improve this answer
    
It worked. Thanks much! –  Josh Pennington Jan 9 '13 at 20:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.