I want to use multiple data sources in a DataImporthandler in Solr and pass the URL value in the child object after querying the database in the parent object. Here is my rss-data-config file:
<dataConfig> <dataSource type="JdbcDataSource" name="ds-db" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/HCDACoreDB" user="root" password=" CDA@318 "/> <dataSource type="URLDataSource" name="ds-url"/> <document> <entity name="feeds" query="select f.feedurl, f.feedsource, c.categoryname from feeds f, category c where f.feedcategory = c.categoryid"> <field column="feedurl" name="url" dataSource="ds-db"/> <field column="categoryname" name="category" dataSource="ds-db"/> <field column="feedsource" name="source" dataSource="ds-db"/> <entity name="rss" transformer="HTMLStripTransformer" forEach="/RDF/channel | /RDF/item" processor="XPathEntityProcessor" url="${dataimporter.functions.encodeUrl(feeds.feedurl)}" > <field column="source-link" dataSource="ds-url" xpath="/rss/channel/link" commonField="true" /> <field column="Source-desc" dataSource="ds-url" xpath="/rss/channel/description" commonField="true" /> <field column="title" dataSource="ds-url" xpath="/rss/channel/item/title" /> <field column="link" dataSource="ds-url" xpath="/rss/channel/item/link" /> <field column="description" dataSource="ds-url" xpath="/rss/channel/item/description" stripHTML="true"/> <field column="pubDate" dataSource="ds-url" xpath="/rss/channel/item/pubDate" /> <field column="guid" dataSource="ds-url" xpath="/rss/channel/item/guid" /> <field column="content" dataSource="ds-url" xpath="/rss/channel/item/content" /> <field column="author" dataSource="ds-url" xpath="/rss/channel/item/creator" /> </entity> </entity> </document>
What am I doing in the first object named feeds I am querying the database and want to use feedurl as the url of the names of the rss child objects.
The error I get when starting dataimport: java.net.MalformedURLException: no protocol: nullselect f.feedurl, f.feedsource, c.categoryname from feeds f, category c, where f .feedcategory = c.categoryid
The URL us NULL means that it does not assign the feedurl URL.
Any suggestion on what I'm doing wrong?
Jayku source share