Hi Peter,

I think you meant faceting on cat_name_raw field.
facet=true&facet.field=cat_name_raw

Second check if that field is actually popupated. Below URL or at Schema 
Browser link.
q=*:*&fl=cat_name* 

Ahmet

On Thursday, January 2, 2014 8:45 PM, PeterKerk <vettepa...@hotmail.com> wrote:
I've set up Solr with MySQL.
My data import is succesful:
http://localhost:8983/solr/wordpress/dataimport?command=full-import

However, when trying to get the cat_name facets all facets are empty: 
http://localhost:8983/solr/wordpress/select/?indent=on&facet=true&sort=post_modified%20desc&q=*:*&start=0&rows=10&fl=id,post_title&facet.field=cat_name&facet.mincount=1

**data-config.xml**
    <dataConfig>
    <dataSource type="JdbcDataSource" driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/wordp" user="***" password="***" />
        <document name="articles">
            <entity pk="ID" name="article" query="SELECT p.*, ( SELECT guid FROM
wp_posts WHERE id = m.meta_value ) AS imgurl 
    FROM wp_posts p
    LEFT JOIN  wp_postmeta m ON(p.id = m.post_id AND m.meta_key = 
'_thumbnail_id' )
    WHERE p.post_type =  'post'
    AND p.post_status =  'publish';">
            
                <entity name="post_categories" query="select wt.name as
cat_name,wt.slug,wtr.term_taxonomy_id,wtt.term_id,wtt.taxonomy from 
    wp_term_relationships wtr
    INNER JOIN wp_term_taxonomy wtt ON
wtt.term_taxonomy_id=wtr.term_taxonomy_id AND wtt.taxonomy='category'
    INNER JOIN wp_terms wt ON wt.term_id=wtt.term_taxonomy_id
    where wtr.object_id='${article.id}';">
                </entity>    
            </entity>
        </document>
    </dataConfig>


**schema.xml**

    <field name="cat_name" type="text" indexed="true" stored="true"
multiValued="true"  />    
    <field name="cat_name_raw" type="string" indexed="true" stored="true"
multiValued="true" />
    <copyField source="cat_name" dest="cat_name_raw"/>

What am I missing?

    
    



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Empty-facets-on-Solr-with-MySQL-tp4109170.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to