![]() |
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 SharePoint, you can easily import SharePoint 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 SharePoint data for use in enterprise search.
Accessing and integrating live data from SharePoint has never been easier with CData. Customers rely on CData connectivity to:
Most customers rely on CData solutions to integrate SharePoint data into their database or data warehouse, while others integrate their SharePoint data with preferred data tools, like Power BI, Tableau, or Excel.
For more information on how customers are solving problems with CData's SharePoint solutions, refer to our blog: Drivers in Focus: Collaboration Tools.
> 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
SharePointUniqueKeyπ Define schema in Solr for SharePoint data.
Now we are ready to use SharePoint 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.sharepoint.SharePointDriver" url="jdbc:sharepoint:User=myuseraccount;Password=mypassword;Auth Scheme=NTLM;URL=http://sharepointserver/mysite;SharePointEdition=SharePointOnPremise;">
</dataSource>
<document>
<entity name="MyCustomList"
query="SELECT Id,SharePointColumn1,SharePointColumn2,SharePointColumn3,SharePointColumn4,SharePointColumn5,SharePointColumn6,SharePointColumn7,LastModifiedDate FROM MyCustomList"
deltaQuery="SELECT Id FROM MyCustomList where LastModifiedDate >= '${dataimporter.last_index_time}'"
deltaImportQuery="SELECT Id,SharePointColumn1,SharePointColumn2,SharePointColumn3,SharePointColumn4,SharePointColumn5,SharePointColumn6,SharePointColumn7,LastModifiedDate FROM MyCustomList where Id=${dataimporter.delta.Id}">
<field column="Id" name="Id" ></field>
<field column="SharePointColumn1" name="SharePointColumn1" ></field>
<field column="SharePointColumn2" name="SharePointColumn2" ></field>
<field column="SharePointColumn3" name="SharePointColumn3" ></field>
<field column="SharePointColumn4" name="SharePointColumn4" ></field>
<field column="SharePointColumn5" name="SharePointColumn5" ></field>
<field column="SharePointColumn6" name="SharePointColumn6" ></field>
<field column="SharePointColumn7" name="SharePointColumn7" ></field>
<field column="LastModifiedDate" name="LastModifiedDate" ></field>
</entity>
</document>
</dataConfig>> solr stop -all > solr start
Using the CData JDBC Driver for SharePoint you are able to create an automated import of SharePoint 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 SharePoint Driver to get started:
Download NowLearn more:
π SharePoint IconProvides Java developers with the power to easily connect their Web, Desktop, and Mobile applications to data in SharePoint Server Lists, Contacts, Calendar, Links, Tasks, and more!