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 roySolr <ro...@gmail.com> on 2011/07/01 14:52:15 UTC

SOLR and SQL functions

Hello,

I have made my own sql function(isSoccerClub). In my sql query browser this
works fine. My query looks like:

select *
from soccer
where isSoccerClub(id,name) = 1;

Now i try to use this with the DIH. It looks like this:

<entity name="soccerclubs_entity" query="select *
                                                                from soccer
                                                                where
isSoccerClub(id,name) = 1">
</entity>

Now i get some error with the full-import: Indexing failed. Rolled back all
changes.

without "where isSoccerClub(id,name) = 1;" it works fine. Does SOLR not
support sql functions(transact-sql)??

--
View this message in context: http://lucene.472066.n3.nabble.com/SOLR-and-SQL-functions-tp3129175p3129175.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: SOLR and SQL functions

Posted by roySolr <ro...@gmail.com>.
I have found the problem. Some records has incorrect data. Thanks for your
help so far!!

--
View this message in context: http://lucene.472066.n3.nabble.com/SOLR-and-SQL-functions-tp3129175p3129409.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: SOLR and SQL functions

Posted by roySolr <ro...@gmail.com>.
Ok, i checked my error logs and find some problems.

SET NAMES latin1
 SET character_set_results = NULL
 SHOW VARIABLES
 SHOW COLLATION
 SET autocommit=1
 SET sql_mode='STRICT_TRANS_TABLES'
 SET autocommit=0
select * from soccer where isSoccerClub(id,name) = 1;

I see that the sql_mode is set to STRICT TRANS TABLES. When i run this part
in mysql i 
get errors. Without sql_mode it works. Can i change this variable or do you
know a better solution? 


--
View this message in context: http://lucene.472066.n3.nabble.com/SOLR-and-SQL-functions-tp3129175p3129342.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: SOLR and SQL functions

Posted by Stefan Matheis <ma...@googlemail.com>.
that doesn't matter for solr .. it's just executing your query via
jdbc .. so the complete error-message would be intersting. have a look
at the error-log of your sql-server too (especially for the timeframe
while the dataimport is running)

regards
Stefan

On Fri, Jul 1, 2011 at 2:52 PM, roySolr <ro...@gmail.com> wrote:
> Hello,
>
> I have made my own sql function(isSoccerClub). In my sql query browser this
> works fine. My query looks like:
>
> select *
> from soccer
> where isSoccerClub(id,name) = 1;
>
> Now i try to use this with the DIH. It looks like this:
>
> <entity name="soccerclubs_entity" query="select *
>                                                                from soccer
>                                                                where
> isSoccerClub(id,name) = 1">
> </entity>
>
> Now i get some error with the full-import: Indexing failed. Rolled back all
> changes.
>
> without "where isSoccerClub(id,name) = 1;" it works fine. Does SOLR not
> support sql functions(transact-sql)??
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/SOLR-and-SQL-functions-tp3129175p3129175.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>