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 Lokn <nl...@gmail.com> on 2013/12/13 10:39:46 UTC

SOLR DIH - Sub Entity with different datasource not working

Hi,
I have the data-config.xml with 2 data sources and the entity and sub
sub-entity connecting to datasource1 and datasource2 respectively.
When I do the full import, it is giving an error,
Exception :  org.apache.solr.handler.dataimport.DataImportHandlerException:
Unable to execute query: 

This is my db-data-config.xml  configuration file:

 <dataSource name="datasource1" type="JdbcDataSource" 
driver="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@blah" user="aaa"
password=aaa" /> 

 <dataSource name="datasource2" type="JdbcDataSource" 
driver="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@blah" user="bbb"
password="bbb" /> 
       
<document> 
      
	<entity name="item1" dataSource="datasource1" query="select NAME,
CREATED_BY from CSPR_TABLE">
             <field column="NAME" name="name"/>
	     <field column="CREATED_BY" name="user"/>
	     
            <entity name="itemSubEntity" dataSource="datasource1"
query="select USER_ID , PREF from PREF     where USER_ID =
'${item1.CREATED_BY}'">
	     		<field column="USER_ID" name="uid"/>
			<field column="PREF" name="pref"/>
	     </entity>
        </entity>
</document>

Let me know if there is anything wrong in this.

Thanks,
Lokesh



--
View this message in context: http://lucene.472066.n3.nabble.com/SOLR-DIH-Sub-Entity-with-different-datasource-not-working-tp4106550.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: SOLR DIH - Sub Entity with different datasource not working

Posted by Karan Ahuja <ka...@gmail.com>.
hi

i dont know if this can be done

but to avoid this you can create a new table with the results and index
that new table :)
you can then delete the table as well after indexing ...

:)

tc cheers
karan



On Mon, Dec 16, 2013 at 5:42 PM, Lokn <nl...@gmail.com> wrote:

> Thanks for the reply.
>
> The error shows it is not able to execute the query.
> In my case, if you see my config file I am joining the entities between two
> different datasources..
>
> i.e., Entity1 - Datasource1
>          --Subentity - DataSource2
>
> My doubt is, can we join the entities in two different datasources. Is this
> fine..
>
>
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/SOLR-DIH-Sub-Entity-with-different-datasource-not-working-tp4106550p4106906.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

RE: SOLR DIH - Sub Entity with different datasource not working

Posted by Lokn <nl...@gmail.com>.
Thanks for the reply.

The error shows it is not able to execute the query.
In my case, if you see my config file I am joining the entities between two
different datasources..

i.e., Entity1 - Datasource1
         --Subentity - DataSource2

My doubt is, can we join the entities in two different datasources. Is this
fine..





--
View this message in context: http://lucene.472066.n3.nabble.com/SOLR-DIH-Sub-Entity-with-different-datasource-not-working-tp4106550p4106906.html
Sent from the Solr - User mailing list archive at Nabble.com.

RE: SOLR DIH - Sub Entity with different datasource not working

Posted by "Dyer, James" <Ja...@ingramcontent.com>.
Without more of the stacktrace I don't think you'll get much help.  However, its my experience that exceptions that begin with "Unable to execute query" mean the db didn't like something about one or both queries.  I think it would have listed in there somewhere the actual query it didn't like, depending on your db driver.  If memory serves correct, i think the oracle driver also lists out why it didn't like the query in the exception.

James Dyer
Ingram Content Group
(615) 213-4311


-----Original Message-----
From: Lokn [mailto:nlokesh.17@gmail.com] 
Sent: Friday, December 13, 2013 3:40 AM
To: solr-user@lucene.apache.org
Subject: SOLR DIH - Sub Entity with different datasource not working

Hi,
I have the data-config.xml with 2 data sources and the entity and sub
sub-entity connecting to datasource1 and datasource2 respectively.
When I do the full import, it is giving an error,
Exception :  org.apache.solr.handler.dataimport.DataImportHandlerException:
Unable to execute query: 

This is my db-data-config.xml  configuration file:

 <dataSource name="datasource1" type="JdbcDataSource" 
driver="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@blah" user="aaa"
password=aaa" /> 

 <dataSource name="datasource2" type="JdbcDataSource" 
driver="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@blah" user="bbb"
password="bbb" /> 
       
<document> 
      
	<entity name="item1" dataSource="datasource1" query="select NAME,
CREATED_BY from CSPR_TABLE">
             <field column="NAME" name="name"/>
	     <field column="CREATED_BY" name="user"/>
	     
            <entity name="itemSubEntity" dataSource="datasource1"
query="select USER_ID , PREF from PREF     where USER_ID =
'${item1.CREATED_BY}'">
	     		<field column="USER_ID" name="uid"/>
			<field column="PREF" name="pref"/>
	     </entity>
        </entity>
</document>

Let me know if there is anything wrong in this.

Thanks,
Lokesh



--
View this message in context: http://lucene.472066.n3.nabble.com/SOLR-DIH-Sub-Entity-with-different-datasource-not-working-tp4106550.html
Sent from the Solr - User mailing list archive at Nabble.com.