![]() |
VOOZH | about |
The Apache Solr platform is a popular, blazing-fast, open source enterprise search solution built on Apache Lucene.
Apache Solr is equipped with the Data Import Handler (DIH), which can import data from databases and, XML, CSV, and JSON files. When paired with the CData JDBC Driver for SAP, you can easily import SAP data to Apache Solr. In this article, we show step-by-step how to use CData JDBC Driver in Apache Solr Data Import Handler and import SAP data for use in enterprise search.
CData provides the easiest way to access and integrate live data from SAP. Customers use CData connectivity to:
While most users leverage our tools to replicate SAP data to databases or data warehouses, many also integrate live SAP data with analytics tools such as Tableau, Power BI, and Excel.
> solr create -c CDataCoreFor this article, Solr is running as a standalone instance in the local environment and you can access the core at this URL: http://localhost:8983/solr/#/CDataCore/core-overview
SAPERPUniqueKeyπ Define schema in Solr for SAP data.
Now we are ready to use SAP data in Solr.
In this section, we walk through configuring the Data Import Handler.
<lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-dataimporthandler-.*\.jar" />
<requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
<lst name="defaults">
<str name="config">solr-data-config.xml</str>
</lst>
</requestHandler>
<dataConfig>
<dataSource driver="cdata.jdbc.saperp.SAPERPDriver" url="jdbc:saperp:Host=sap.mydomain.com;User=EXT90033;Password=xxx;Client=800;System Number=09;ConnectionType=Classic;Location=C:/mysapschemafolder;">
</dataSource>
<document>
<entity name="MARA"
query="SELECT Id,SAPERPColumn1,SAPERPColumn2,SAPERPColumn3,SAPERPColumn4,SAPERPColumn5,SAPERPColumn6,SAPERPColumn7,LastModifiedDate FROM MARA"
deltaQuery="SELECT Id FROM MARA where LastModifiedDate >= '${dataimporter.last_index_time}'"
deltaImportQuery="SELECT Id,SAPERPColumn1,SAPERPColumn2,SAPERPColumn3,SAPERPColumn4,SAPERPColumn5,SAPERPColumn6,SAPERPColumn7,LastModifiedDate FROM MARA where Id=${dataimporter.delta.Id}">
<field column="Id" name="Id" ></field>
<field column="SAPERPColumn1" name="SAPERPColumn1" ></field>
<field column="SAPERPColumn2" name="SAPERPColumn2" ></field>
<field column="SAPERPColumn3" name="SAPERPColumn3" ></field>
<field column="SAPERPColumn4" name="SAPERPColumn4" ></field>
<field column="SAPERPColumn5" name="SAPERPColumn5" ></field>
<field column="SAPERPColumn6" name="SAPERPColumn6" ></field>
<field column="SAPERPColumn7" name="SAPERPColumn7" ></field>
<field column="LastModifiedDate" name="LastModifiedDate" ></field>
</entity>
</document>
</dataConfig>> solr stop -all > solr start
Using the CData JDBC Driver for SAP you are able to create an automated import of SAP data into Apache Solr. Download a free, 30 day trial of any of the hundreds of CData JDBC Drivers and get started today.
Download a free trial of the SAP ERP Driver to get started:
Download NowLearn more:
π SAP ERP IconStraightforward SAP ERP integration. Now accessing SAP RFC's from any JDBC client is as easy as querying a database.