You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by PeterKerk <ve...@hotmail.com> on 2014/01/02 19:44:03 UTC

Empty facets on Solr with MySQL

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.

Re: Empty facets on Solr with MySQL

Posted by Andrea Gazzarini <a....@gmail.com>.
Nice to hear you (not me) solved the problem. You're welcome

Andrea
On 3 Jan 2014 21:19, "PeterKerk" <ve...@hotmail.com> wrote:

> No need, you solved it!
> It was the id name, it had to be uppercase.
>
> btw the ; is still there in the query, but everything still works.
>
> Thanks!
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Empty-facets-on-Solr-with-MySQL-tp4109170p4109425.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: Empty facets on Solr with MySQL

Posted by PeterKerk <ve...@hotmail.com>.
No need, you solved it!
It was the id name, it had to be uppercase.

btw the ; is still there in the query, but everything still works.

Thanks!



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

Re: Empty facets on Solr with MySQL

Posted by Andrea Gazzarini <a....@gmail.com>.
I don't remember your dih-config.xml (could you post it again?)

- remove the trailing ; from the query. It is a valid delimiter only when
you run queries in mysql worlbench;

- I assume there's a parent entity named (name=) article.

- are you sure the column of the article entity is "id" (NB this time case
sensitive)?

Andrea
On 3 Jan 2014 19:33, "PeterKerk" <ve...@hotmail.com> wrote:

> Hi Andrea,
>
> I think you helped me to get closer, but not quite there yet.
>
> When I replace wtr.object_id='${article.id}'; with wtr.object_id=18
> the cat_name field holds a value, which I checked via the schema browser of
> Solr dashboard!
>
> I then checked my main 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';
>
> which returns 4 results. For each of these results I checked whether the
> direct query on the database returns a cat_name and it does. So, no null
> values there.
>
>
> When I remove the quotes around the ID like so
>
>             <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};">
>
> I get the errors:
>
> Caused by: org.apache.solr.handler.dataimport.DataImportHandlerException:
> Unable
>  to execute query: select wt.name as
> cat_name,wt.slug,wtr.term_taxonomy_id,wtt.t
> erm_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'
> INN
> ER JOIN wp_terms wt ON wt.term_id=wtt.term_taxonomy_id where
> wtr.object_id=;
> Pro
> cessing Document # 1
>         at
> org.apache.solr.handler.dataimport.DataImportHandlerException.wrapAnd
> Throw(DataImportHandlerException.java:71)
>         at
> org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator.<
> init>(JdbcDataSource.java:253)
>         at
> org.apache.solr.handler.dataimport.JdbcDataSource.getData(JdbcDataSou
> rce.java:210)
>         at
> org.apache.solr.handler.dataimport.JdbcDataSource.getData(JdbcDataSou
> rce.java:38)
>         at
> org.apache.solr.handler.dataimport.SqlEntityProcessor.initQuery(SqlEn
> tityProcessor.java:59)
>         at
> org.apache.solr.handler.dataimport.SqlEntityProcessor.nextRow(SqlEnti
> tyProcessor.java:73)
>         at
> org.apache.solr.handler.dataimport.EntityProcessorWrapper.nextRow(Ent
> ityProcessorWrapper.java:243)
>         at
> org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilde
> r.java:465)
>         at
> org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilde
> r.java:491)
>         at
> org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilde
> r.java:404)
>         ... 5 more
> Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You
> have a
> n error in your SQL syntax; check the manual that corresponds to your MySQL
> serv
> er version for the right syntax to use near '' at line 1
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
>
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown
> Source)
>
>         at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
> Sou
> rce)
>         at java.lang.reflect.Constructor.newInstance(Unknown Source)
>         at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
>         at com.mysql.jdbc.Util.getInstance(Util.java:386)
>         at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054)
>         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4237)
>         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4169)
>         at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2617)
>         at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2778)
>         at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2819)
>         at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2768)
>         at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:894)
>         at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:732)
>         at
> org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator.<
> init>(JdbcDataSource.java:246)
>         ... 13 more
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Empty-facets-on-Solr-with-MySQL-tp4109170p4109398.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: Empty facets on Solr with MySQL

Posted by PeterKerk <ve...@hotmail.com>.
Hi Andrea,

I think you helped me to get closer, but not quite there yet.

When I replace wtr.object_id='${article.id}'; with wtr.object_id=18 
the cat_name field holds a value, which I checked via the schema browser of
Solr dashboard!

I then checked my main 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';

which returns 4 results. For each of these results I checked whether the
direct query on the database returns a cat_name and it does. So, no null
values there.


When I remove the quotes around the ID like so

            <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};">

I get the errors:

Caused by: org.apache.solr.handler.dataimport.DataImportHandlerException:
Unable
 to execute query: select wt.name as
cat_name,wt.slug,wtr.term_taxonomy_id,wtt.t
erm_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'
INN
ER JOIN wp_terms wt ON wt.term_id=wtt.term_taxonomy_id where wtr.object_id=;
Pro
cessing Document # 1
        at
org.apache.solr.handler.dataimport.DataImportHandlerException.wrapAnd
Throw(DataImportHandlerException.java:71)
        at
org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator.<
init>(JdbcDataSource.java:253)
        at
org.apache.solr.handler.dataimport.JdbcDataSource.getData(JdbcDataSou
rce.java:210)
        at
org.apache.solr.handler.dataimport.JdbcDataSource.getData(JdbcDataSou
rce.java:38)
        at
org.apache.solr.handler.dataimport.SqlEntityProcessor.initQuery(SqlEn
tityProcessor.java:59)
        at
org.apache.solr.handler.dataimport.SqlEntityProcessor.nextRow(SqlEnti
tyProcessor.java:73)
        at
org.apache.solr.handler.dataimport.EntityProcessorWrapper.nextRow(Ent
ityProcessorWrapper.java:243)
        at
org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilde
r.java:465)
        at
org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilde
r.java:491)
        at
org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilde
r.java:404)
        ... 5 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You
have a
n error in your SQL syntax; check the manual that corresponds to your MySQL
serv
er version for the right syntax to use near '' at line 1
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)

        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown
Source)

        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Sou
rce)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
        at com.mysql.jdbc.Util.getInstance(Util.java:386)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4237)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4169)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2617)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2778)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2819)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2768)
        at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:894)
        at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:732)
        at
org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator.<
init>(JdbcDataSource.java:246)
        ... 13 more



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

Re: Empty facets on Solr with MySQL

Posted by Andrea Gazzarini <a....@gmail.com>.
Or, in other words, assuming that the example you reported (article.id=18)
returns a record with cat_name, could you hardcode that id in your
dih-config (replacing ${article.id} with 18) and try to run a full-import?

Another important thing: in your example you are using the object_id as an
int (object_id=18) but not in dih-config.xml where you are using quotes
(object_id=' ${article.id}')....although jdbc drivers often handle this
conversion magically this is not very good. Is object_id a string or a
number?
On 3 Jan 2014 18:53, "Andrea Gazzarini" <a....@gmail.com> wrote:

> Yes, that definitely matters...I was talking about a simple java class.
>
> Peter, sincerely? I don't know.
>
> Are you sure you are doing then same queries with the same article.id as
> solr does? and sorry for the stupid question but are you sure that for
> those article ids the cat_name is not null?
>  On 3 Jan 2014 18:37, "PeterKerk" <ve...@hotmail.com> wrote:
>
>> But when I execute the query directly on MySQL I do get a cat_name column
>> in
>> there:
>>
>> 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=18
>>
>> I see no reason why my configuration in my data-config.xml would not
>> execute
>> successfully:
>>
>>             <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>
>>
>>
>> I have no transformers on my resultset (I checked my querystring,
>> schema.xml
>> and data-config.xml, since I'm not even sure where it would have to be
>> defined).
>>
>>
>>
>> Andrea Gazzarini-4 wrote
>> > You can debug the resultset in a main class by doing rs.getString
>> > ("cat_name")
>>
>> What do you mean by 'in a main class'? Where can I define that? (ps. I'm
>> working with ASP.NET if that matters)
>>
>> Thanks again! :)
>>
>>
>>
>> --
>> View this message in context:
>> http://lucene.472066.n3.nabble.com/Empty-facets-on-Solr-with-MySQL-tp4109170p4109388.html
>> Sent from the Solr - User mailing list archive at Nabble.com.
>>
>

Re: Empty facets on Solr with MySQL

Posted by Andrea Gazzarini <a....@gmail.com>.
Yes, that definitely matters...I was talking about a simple java class.

Peter, sincerely? I don't know.

Are you sure you are doing then same queries with the same article.id as
solr does? and sorry for the stupid question but are you sure that for
those article ids the cat_name is not null?
 On 3 Jan 2014 18:37, "PeterKerk" <ve...@hotmail.com> wrote:

> But when I execute the query directly on MySQL I do get a cat_name column
> in
> there:
>
> 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=18
>
> I see no reason why my configuration in my data-config.xml would not
> execute
> successfully:
>
>             <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>
>
>
> I have no transformers on my resultset (I checked my querystring,
> schema.xml
> and data-config.xml, since I'm not even sure where it would have to be
> defined).
>
>
>
> Andrea Gazzarini-4 wrote
> > You can debug the resultset in a main class by doing rs.getString
> > ("cat_name")
>
> What do you mean by 'in a main class'? Where can I define that? (ps. I'm
> working with ASP.NET if that matters)
>
> Thanks again! :)
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Empty-facets-on-Solr-with-MySQL-tp4109170p4109388.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: Empty facets on Solr with MySQL

Posted by PeterKerk <ve...@hotmail.com>.
But when I execute the query directly on MySQL I do get a cat_name column in
there:

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=18

I see no reason why my configuration in my data-config.xml would not execute
successfully:

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


I have no transformers on my resultset (I checked my querystring, schema.xml
and data-config.xml, since I'm not even sure where it would have to be
defined).



Andrea Gazzarini-4 wrote
> You can debug the resultset in a main class by doing rs.getString 
> ("cat_name") 

What do you mean by 'in a main class'? Where can I define that? (ps. I'm
working with ASP.NET if that matters)

Thanks again! :)



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

Re: Empty facets on Solr with MySQL

Posted by Andrea Gazzarini <a....@gmail.com>.
Hi Peter,
I can only guess that the result set doesn't contain a "cat_name" (case
insensitive) column. Other option / question: do you have a transformer
(like scriptTransformer) that manipulates the resultset?

You can debug the resultset in a main class by doing rs.getString
("cat_name")

Cheers,
Andrea
On 3 Jan 2014 15:01, "PeterKerk" <ve...@hotmail.com> wrote:

> Hi Andrea,
>
> Here you go:
>
> **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"/>
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Empty-facets-on-Solr-with-MySQL-tp4109170p4109353.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: Empty facets on Solr with MySQL

Posted by PeterKerk <ve...@hotmail.com>.
Hi Andrea,

Here you go:

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



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

Re: Empty facets on Solr with MySQL

Posted by Andrea Gazzarini <ag...@apache.org>.
Hi Peter,
Umfprtunately I deleted your first email where you wrote a piece of your
schema...the problem seems to be "cat_name" and not cat_name_raw...could
you please post again your schema?
 On 3 Jan 2014 13:40, "PeterKerk" <ve...@hotmail.com> wrote:

> Hi Andrea,
>
> You were right, I do see errors when setting the required=true
> attribute...what can it be?
>
>
> Logging console homepage:
>
> 13:31:54
> WARN
> SolrWriter
> Error creating document : SolrInputDocument[comment_status=open,
> post_content=algemeen kpn artikeltje ook over vodafone,
> guid=http://www.telefonievergelijken.nl/wordpress/?p=20, post_excerpt=,
> id=20, post_author=1, post_modified=2014-01-02 14:24:28.0,
> post_name=kpn-en-vodafone, post_title=KPN en Vodafone,
> imgurl=http://www.talkman.nl/wordpress/wp-content/uploads/2013/11/taj.png,
> 
> post_date=2013-12-13 14:12:17.0]
>
> Console errors:
>
> 36588 [Thread-15] WARN  org.apache.solr.handler.dataimport.SolrWriter  û
> Error c
> reating document : SolrInputDocument[comment_status=open,
> post_content=algemeen
> kpn artikeltje ook over vodafone,
> guid=http://www.telefonievergelijken.nl/wordpr
> ess/?p=20, post_excerpt=, id=20, post_author=1, post_modified=2014-01-02
> 14:24:2
> 8.0, post_name=kpn-en-vodafone, post_title=KPN en Vodafone,
> imgurl=http://www.ta
> lkman.nl/wordpress/wp-content/uploads/2013/11/taj.png,
> post_date=2013-12-13
> 14:1
> 2:17.0]
> org.apache.solr.common.SolrException: [doc=20] missing required field:
> cat_name
>         at
> org.apache.solr.update.DocumentBuilder.toDocument(DocumentBuilder.jav
> a:328)
>         at
> org.apache.solr.update.AddUpdateCommand.getLuceneDocument(AddUpdateCo
> mmand.java:73)
>         at
> org.apache.solr.update.DirectUpdateHandler2.addDoc(DirectUpdateHandle
> r2.java:208)
>         at
> org.apache.solr.update.processor.RunUpdateProcessor.processAdd(RunUpd
> ateProcessorFactory.java:69)
>         at
> org.apache.solr.update.processor.UpdateRequestProcessor.processAdd(Up
> dateRequestProcessor.java:51)
>         at
> org.apache.solr.update.processor.DistributedUpdateProcessor.versionAd
> d(DistributedUpdateProcessor.java:545)
>         at
> org.apache.solr.update.processor.DistributedUpdateProcessor.processAd
> d(DistributedUpdateProcessor.java:398)
>         at
> org.apache.solr.update.processor.LogUpdateProcessor.processAdd(LogUpd
> ateProcessorFactory.java:100)
>         at
> org.apache.solr.handler.dataimport.SolrWriter.upload(SolrWriter.java:
> 70)
>         at
> org.apache.solr.handler.dataimport.DataImportHandler$1.upload(DataImp
> ortHandler.java:235)
>         at
> org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilde
> r.java:500)
>         at
> org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilde
> r.java:404)
>         at
> org.apache.solr.handler.dataimport.DocBuilder.doFullDump(DocBuilder.j
> ava:319)
>         at
> org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java
> :227)
>         at
> org.apache.solr.handler.dataimport.DataImporter.doFullImport(DataImpo
> rter.java:422)
>         at
> org.apache.solr.handler.dataimport.DataImporter.runCmd(DataImporter.j
> ava:487)
>         at
> org.apache.solr.handler.dataimport.DataImporter$1.run(DataImporter.ja
> va:468)
> 36596 [Thread-15] INFO  org.apache.solr.handler.dataimport.DocBuilder  û
> Import
> completed successfully
> 36596 [Thread-15] INFO  org.apache.solr.update.UpdateHandler  û start
> commit{,op
>
> timize=false,openSearcher=true,waitSearcher=true,expungeDeletes=false,softCommit
> =false,prepareCommit=false}
> 36601 [Thread-15] INFO  org.apache.solr.core.SolrCore  û
> SolrDeletionPolicy.onCo
> mmit: commits:num=2
>
> commit{dir=NRTCachingDirectory(org.apache.lucene.store.SimpleFSDirectory
>
> @C:\Dropbox\Databases\solr-4.3.1\example\example-DIH\solr\tv-wordpress\data\inde
> x lockFactory=org.apache.lucene.store.SingleInstanceLockFactory@1836cd1;
> maxCach
> eMB=48.0
> maxMergeSizeMB=4.0),segFN=segments_4o,generation=168,filenames=[segment
> s_4o]
>
> commit{dir=NRTCachingDirectory(org.apache.lucene.store.SimpleFSDirectory
>
> @C:\Dropbox\Databases\solr-4.3.1\example\example-DIH\solr\tv-wordpress\data\inde
> x lockFactory=org.apache.lucene.store.SingleInstanceLockFactory@1836cd1;
> maxCach
> eMB=48.0
> maxMergeSizeMB=4.0),segFN=segments_4p,generation=169,filenames=[segment
> s_4p]
> 36602 [Thread-15] INFO  org.apache.solr.core.SolrCore  û newest commit =
> 169[seg
> ments_4p]
> 36603 [Thread-15] INFO  org.apache.solr.search.SolrIndexSearcher  û Opening
> Sear
> cher@54dfcf main
> 36604 [Thread-15] INFO  org.apache.solr.update.UpdateHandler  û
> end_commit_flush
>
> 36604 [searcherExecutor-79-thread-1] INFO  org.apache.solr.core.SolrCore  û
> Quer
> ySenderListener sending requests to Searcher@54dfcf
> main{StandardDirectoryReader
> (segments_4p:1330871938621:nrt)}
> 36608 [searcherExecutor-79-thread-1] INFO  org.apache.solr.core.SolrCore  û
> [tv-
> wordpress] webapp=null path=null
> params={start=0&event=newSearcher&q=solr&distri
> b=false&rows=10} hits=0 status=0 QTime=4
> 36609 [searcherExecutor-79-thread-1] INFO  org.apache.solr.core.SolrCore  û
> [tv-
> wordpress] webapp=null path=null
> params={start=0&event=newSearcher&q=rocks&distr
> ib=false&rows=10} hits=0 status=0 QTime=0
> 36610 [searcherExecutor-79-thread-1] INFO  org.apache.solr.core.SolrCore  û
> [tv-
> wordpress] webapp=null path=null
> params={event=newSearcher&q=static+newSearcher+
> warming+query+from+solrconfig.xml&distrib=false} hits=0 status=0 QTime=1
> 36610 [searcherExecutor-79-thread-1] INFO  org.apache.solr.core.SolrCore  û
> Quer
> ySenderListener done.
> 36610 [searcherExecutor-79-thread-1] INFO  org.apache.solr.core.SolrCore  û
> [tv-
> wordpress] Registered new searcher Searcher@54dfcf
> main{StandardDirectoryReader(
> segments_4p:1330871938621:nrt)}
> 36611 [Thread-15] INFO
> org.apache.solr.handler.dataimport.SimplePropertiesWrite
> r  û Read dataimport.properties
> 36614 [Thread-15] INFO
> org.apache.solr.handler.dataimport.SimplePropertiesWrite
> r  û Wrote last indexed time to dataimport.properties
> 36614 [Thread-15] INFO  org.apache.solr.handler.dataimport.DocBuilder  û
> Time ta
> ken = 0:0:0.367
> 36614 [Thread-15] INFO  org.apache.solr.update.processor.LogUpdateProcessor
> û [
> tv-wordpress] webapp=/solr path=/dataimport params={command=full-import}
> status=
> 0 QTime=13 {deleteByQuery=*:*,commit=} 0 13
>
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Empty-facets-on-Solr-with-MySQL-tp4109170p4109330.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: Empty facets on Solr with MySQL

Posted by PeterKerk <ve...@hotmail.com>.
Hi Andrea,

You were right, I do see errors when setting the required=true
attribute...what can it be?


Logging console homepage:

13:31:54
WARN
SolrWriter
Error creating document : SolrInputDocument[comment_status=open,​
post_content=algemeen kpn artikeltje ook over vodafone,​
guid=http://www.telefonievergelijken.nl/wordpress/?p=20,​ post_excerpt=,​
id=20,​ post_author=1,​ post_modified=2014-01-02 14:24:28.0,​
post_name=kpn-en-vodafone,​ post_title=KPN en Vodafone,​
imgurl=http://www.talkman.nl/wordpress/wp-content/uploads/2013/11/taj.png,​
post_date=2013-12-13 14:12:17.0]

Console errors:

36588 [Thread-15] WARN  org.apache.solr.handler.dataimport.SolrWriter  û
Error c
reating document : SolrInputDocument[comment_status=open,
post_content=algemeen
kpn artikeltje ook over vodafone,
guid=http://www.telefonievergelijken.nl/wordpr
ess/?p=20, post_excerpt=, id=20, post_author=1, post_modified=2014-01-02
14:24:2
8.0, post_name=kpn-en-vodafone, post_title=KPN en Vodafone,
imgurl=http://www.ta
lkman.nl/wordpress/wp-content/uploads/2013/11/taj.png, post_date=2013-12-13
14:1
2:17.0]
org.apache.solr.common.SolrException: [doc=20] missing required field:
cat_name
        at
org.apache.solr.update.DocumentBuilder.toDocument(DocumentBuilder.jav
a:328)
        at
org.apache.solr.update.AddUpdateCommand.getLuceneDocument(AddUpdateCo
mmand.java:73)
        at
org.apache.solr.update.DirectUpdateHandler2.addDoc(DirectUpdateHandle
r2.java:208)
        at
org.apache.solr.update.processor.RunUpdateProcessor.processAdd(RunUpd
ateProcessorFactory.java:69)
        at
org.apache.solr.update.processor.UpdateRequestProcessor.processAdd(Up
dateRequestProcessor.java:51)
        at
org.apache.solr.update.processor.DistributedUpdateProcessor.versionAd
d(DistributedUpdateProcessor.java:545)
        at
org.apache.solr.update.processor.DistributedUpdateProcessor.processAd
d(DistributedUpdateProcessor.java:398)
        at
org.apache.solr.update.processor.LogUpdateProcessor.processAdd(LogUpd
ateProcessorFactory.java:100)
        at
org.apache.solr.handler.dataimport.SolrWriter.upload(SolrWriter.java:
70)
        at
org.apache.solr.handler.dataimport.DataImportHandler$1.upload(DataImp
ortHandler.java:235)
        at
org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilde
r.java:500)
        at
org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilde
r.java:404)
        at
org.apache.solr.handler.dataimport.DocBuilder.doFullDump(DocBuilder.j
ava:319)
        at
org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java
:227)
        at
org.apache.solr.handler.dataimport.DataImporter.doFullImport(DataImpo
rter.java:422)
        at
org.apache.solr.handler.dataimport.DataImporter.runCmd(DataImporter.j
ava:487)
        at
org.apache.solr.handler.dataimport.DataImporter$1.run(DataImporter.ja
va:468)
36596 [Thread-15] INFO  org.apache.solr.handler.dataimport.DocBuilder  û
Import
completed successfully
36596 [Thread-15] INFO  org.apache.solr.update.UpdateHandler  û start
commit{,op
timize=false,openSearcher=true,waitSearcher=true,expungeDeletes=false,softCommit
=false,prepareCommit=false}
36601 [Thread-15] INFO  org.apache.solr.core.SolrCore  û
SolrDeletionPolicy.onCo
mmit: commits:num=2
       
commit{dir=NRTCachingDirectory(org.apache.lucene.store.SimpleFSDirectory
@C:\Dropbox\Databases\solr-4.3.1\example\example-DIH\solr\tv-wordpress\data\inde
x lockFactory=org.apache.lucene.store.SingleInstanceLockFactory@1836cd1;
maxCach
eMB=48.0
maxMergeSizeMB=4.0),segFN=segments_4o,generation=168,filenames=[segment
s_4o]
       
commit{dir=NRTCachingDirectory(org.apache.lucene.store.SimpleFSDirectory
@C:\Dropbox\Databases\solr-4.3.1\example\example-DIH\solr\tv-wordpress\data\inde
x lockFactory=org.apache.lucene.store.SingleInstanceLockFactory@1836cd1;
maxCach
eMB=48.0
maxMergeSizeMB=4.0),segFN=segments_4p,generation=169,filenames=[segment
s_4p]
36602 [Thread-15] INFO  org.apache.solr.core.SolrCore  û newest commit =
169[seg
ments_4p]
36603 [Thread-15] INFO  org.apache.solr.search.SolrIndexSearcher  û Opening
Sear
cher@54dfcf main
36604 [Thread-15] INFO  org.apache.solr.update.UpdateHandler  û
end_commit_flush

36604 [searcherExecutor-79-thread-1] INFO  org.apache.solr.core.SolrCore  û
Quer
ySenderListener sending requests to Searcher@54dfcf
main{StandardDirectoryReader
(segments_4p:1330871938621:nrt)}
36608 [searcherExecutor-79-thread-1] INFO  org.apache.solr.core.SolrCore  û
[tv-
wordpress] webapp=null path=null
params={start=0&event=newSearcher&q=solr&distri
b=false&rows=10} hits=0 status=0 QTime=4
36609 [searcherExecutor-79-thread-1] INFO  org.apache.solr.core.SolrCore  û
[tv-
wordpress] webapp=null path=null
params={start=0&event=newSearcher&q=rocks&distr
ib=false&rows=10} hits=0 status=0 QTime=0
36610 [searcherExecutor-79-thread-1] INFO  org.apache.solr.core.SolrCore  û
[tv-
wordpress] webapp=null path=null
params={event=newSearcher&q=static+newSearcher+
warming+query+from+solrconfig.xml&distrib=false} hits=0 status=0 QTime=1
36610 [searcherExecutor-79-thread-1] INFO  org.apache.solr.core.SolrCore  û
Quer
ySenderListener done.
36610 [searcherExecutor-79-thread-1] INFO  org.apache.solr.core.SolrCore  û
[tv-
wordpress] Registered new searcher Searcher@54dfcf
main{StandardDirectoryReader(
segments_4p:1330871938621:nrt)}
36611 [Thread-15] INFO 
org.apache.solr.handler.dataimport.SimplePropertiesWrite
r  û Read dataimport.properties
36614 [Thread-15] INFO 
org.apache.solr.handler.dataimport.SimplePropertiesWrite
r  û Wrote last indexed time to dataimport.properties
36614 [Thread-15] INFO  org.apache.solr.handler.dataimport.DocBuilder  û
Time ta
ken = 0:0:0.367
36614 [Thread-15] INFO  org.apache.solr.update.processor.LogUpdateProcessor 
û [
tv-wordpress] webapp=/solr path=/dataimport params={command=full-import}
status=
0 QTime=13 {deleteByQuery=*:*,commit=} 0 13




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

Re: Empty facets on Solr with MySQL

Posted by Andrea Gazzarini <a....@gmail.com>.
Hi Peter
Sorry I didn't see your question about the log level. I'm here with my
mobile so cannot guide you step by step (don't remember exactly) but is
very very easy. Prior to solr 4 there was a "logging" hyperlink on the
homepage of the console. Starting from 4 you should see the same link on
the left menu

Best,
Andrea
On 3 Jan 2014 10:21, "PeterKerk" <ve...@hotmail.com> wrote:

> Hi Andrea,
>
> I would say the JDBC driver must be working because when I leave out the
> required="true" from the cat_name field, 4 documents are imported. Since my
> entire DB currently holds only 4 records, there's no need for a LIMIT
> clause
> I guess?
>
>
> Andrea Gazzarini-4 wrote
> > In the solr console set to DEBUG / FINEST the level of DIH classes
>
> How do I do that?
>
> Thanks!
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Empty-facets-on-Solr-with-MySQL-tp4109170p4109290.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: Empty facets on Solr with MySQL

Posted by Andrea Gazzarini <a....@gmail.com>.
Sorry I didn't get the point...so that means

-  if you put the required clause you must have some kind of errors
(because no documets are imported)

- your query doesn't throw out that field

I'm quite sure that if you put again the  required attribute and set to
finest the log level you must see something useful

4 documents are ok you don't need limit at all

Andrea
On 3 Jan 2014 10:21, "PeterKerk" <ve...@hotmail.com> wrote:

> Hi Andrea,
>
> I would say the JDBC driver must be working because when I leave out the
> required="true" from the cat_name field, 4 documents are imported. Since my
> entire DB currently holds only 4 records, there's no need for a LIMIT
> clause
> I guess?
>
>
> Andrea Gazzarini-4 wrote
> > In the solr console set to DEBUG / FINEST the level of DIH classes
>
> How do I do that?
>
> Thanks!
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Empty-facets-on-Solr-with-MySQL-tp4109170p4109290.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: Empty facets on Solr with MySQL

Posted by PeterKerk <ve...@hotmail.com>.
Hi Andrea, 

I would say the JDBC driver must be working because when I leave out the
required="true" from the cat_name field, 4 documents are imported. Since my
entire DB currently holds only 4 records, there's no need for a LIMIT clause
I guess?


Andrea Gazzarini-4 wrote
> In the solr console set to DEBUG / FINEST the level of DIH classes

How do I do that?

Thanks!



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

Re: Empty facets on Solr with MySQL

Posted by Andrea Gazzarini <a....@gmail.com>.
Hi Peter,

> Hi Andrea,
>
> I changed it to: <field name="cat_name" required="true" type="text"
> indexed="true" stored="true" multiValued="true"  />	
>
> When I run full-import 0 documents are indexed, but no errors in the
> console.
That's the reason why you can't see facets and errors: 0 documents are 
indexed
> When I run my query via MySQL Workbench the statement executes correctly.
Once I spent a whole week with a sentence like this: not sure if it is 
the same but: try to run a stupid main that is using the same exact JDBC 
driver / JVM and so on...in that main run the queries and make sure that 
they are working...MySqlWorkbench is not written in java and therefore 
is not using JDBC drivers.
> How else can I debug the index process?
>
In the solr console set to DEBUG / FINEST the level of DIH classes. You 
should see a lot of things so you could set (just for testing) a LIMIT 
in your root query.


Re: Empty facets on Solr with MySQL

Posted by PeterKerk <ve...@hotmail.com>.
Hi Andrea,

I changed it to: <field name="cat_name" required="true" type="text"
indexed="true" stored="true" multiValued="true"  />	

When I run full-import 0 documents are indexed, but no errors in the
console.
When I run my query via MySQL Workbench the statement executes correctly.

How else can I debug the index process?



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

Re: Empty facets on Solr with MySQL

Posted by Andrea Gazzarini <a....@gmail.com>.
Then that means dih is not populating the field..

I guess if you set required=true in your field you will get some error
during indexing

Try to debug the index process and /or run queries outside solr in order to
see results, field names matches and so on

Best,
Andrea
I get "Sorry, no Term Info available :("



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

Re: Empty facets on Solr with MySQL

Posted by PeterKerk <ve...@hotmail.com>.
I get "Sorry, no Term Info available :("



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

Re: Empty facets on Solr with MySQL

Posted by Ahmet Arslan <io...@yahoo.com>.
Hi Peter,

Go to your solr admin page and select your core. Hit the schema-browser URL and select cat_name_raw field. Example URL : http://localhost:8983/solr/#/crawl/schema-browser
Push the 'Load Term info' button, do you see some data there?

ahmet


On Thursday, January 2, 2014 9:23 PM, PeterKerk <ve...@hotmail.com> wrote:
Hi Ahmet,

I tried this URL:

http://localhost:8983/solr/wordpress/select/?indent=on&facet=true&sort=post_modified%20desc&q=*:*&start=0&rows=10&fl=id,post_title,cat_name*&facet.field=cat_name_raw&facet.mincount=1

and this URL:

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_raw&facet.mincount=1

But still I see empty facets. What more can I test?



--
View this message in context: http://lucene.472066.n3.nabble.com/Empty-facets-on-Solr-with-MySQL-tp4109170p4109176.html

Sent from the Solr - User mailing list archive at Nabble.com.


Re: Empty facets on Solr with MySQL

Posted by PeterKerk <ve...@hotmail.com>.
Hi Ahmet,

I tried this URL:

http://localhost:8983/solr/wordpress/select/?indent=on&facet=true&sort=post_modified%20desc&q=*:*&start=0&rows=10&fl=id,post_title,cat_name*&facet.field=cat_name_raw&facet.mincount=1

and this URL:

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_raw&facet.mincount=1

But still I see empty facets. What more can I test?



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

Re: Empty facets on Solr with MySQL

Posted by Ahmet Arslan <io...@yahoo.com>.
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 <ve...@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.