lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From PeterKerk <>
Subject Re: Empty facets on Solr with MySQL
Date Fri, 03 Jan 2014 14:00:32 GMT
Hi Andrea,

Here you go:

        <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( = 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 as cat_name,wt.slug,wtr.term_taxonomy_id,wtt.term_id,wtt.taxonomy
        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='${}';">


        <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"/> 

View this message in context:
Sent from the Solr - User mailing list archive at

View raw message