![]() |
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 Microsoft Dataverse, you can easily import Microsoft Dataverse 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 Microsoft Dataverse data for use in enterprise search.
CData provides the easiest way to access and integrate live data from Microsoft Dataverse (formerly the Common Data Service). Customers use CData connectivity to:
CData customers use our Dataverse connectivity solutions for a variety of reasons, whether they're looking to replicate their data into a data warehouse (alongside other data sources)or analyze live Dataverse data from their preferred data tools inside the Microsoft ecosystem (Power BI, Excel, etc.) or with external tools (Tableau, Looker, etc.).
> 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
CDSUniqueKeyπ Define schema in Solr for Microsoft Dataverse data.
Now we are ready to use Microsoft Dataverse 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.cds.CDSDriver" url="jdbc:cds:OrganizationUrl=https://myaccount.crm.dynamics.com/;InitiateOAuth=GETANDREFRESH;">
</dataSource>
<document>
<entity name="Accounts"
query="SELECT Id,CDSColumn1,CDSColumn2,CDSColumn3,CDSColumn4,CDSColumn5,CDSColumn6,CDSColumn7,LastModifiedDate FROM Accounts"
deltaQuery="SELECT Id FROM Accounts where LastModifiedDate >= '${dataimporter.last_index_time}'"
deltaImportQuery="SELECT Id,CDSColumn1,CDSColumn2,CDSColumn3,CDSColumn4,CDSColumn5,CDSColumn6,CDSColumn7,LastModifiedDate FROM Accounts where Id=${dataimporter.delta.Id}">
<field column="Id" name="Id" ></field>
<field column="CDSColumn1" name="CDSColumn1" ></field>
<field column="CDSColumn2" name="CDSColumn2" ></field>
<field column="CDSColumn3" name="CDSColumn3" ></field>
<field column="CDSColumn4" name="CDSColumn4" ></field>
<field column="CDSColumn5" name="CDSColumn5" ></field>
<field column="CDSColumn6" name="CDSColumn6" ></field>
<field column="CDSColumn7" name="CDSColumn7" ></field>
<field column="LastModifiedDate" name="LastModifiedDate" ></field>
</entity>
</document>
</dataConfig>> solr stop -all > solr start
Using the CData JDBC Driver for Microsoft Dataverse you are able to create an automated import of Microsoft Dataverse 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 Microsoft Dataverse Driver to get started:
Download NowLearn more:
π Microsoft Dataverse IconRapidly create and deploy powerful Java applications that integrate with Microsoft Dataverse.