Dear Mayanky,
Please find patch that updates SolrJ library to 7.5.0. This code stil uses SCR, only the changes needed to update SolrJ library bundled here to 7.5 have been performed.
Index: core/pom.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- core/pom.xml (revision 603009da7fcd67f2b6ae3782edfbd0bb9a98153e)
+++ core/pom.xml (date 1538407473120)
@@ -135,8 +135,13 @@
</dependency>
<!-- Solr Dependencies -->
<dependency>
- <groupId>org.apache.servicemix.bundles</groupId>
- <artifactId>org.apache.servicemix.bundles.solr-solrj</artifactId>
+ <groupId>org.apache.solr</groupId>
+ <artifactId>solr-solrj</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-math3</artifactId>
+ <version>3.6</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Index: core/src/main/java/com/adobe/aem/core/servlets/IndexContentToSolr.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- core/src/main/java/com/adobe/aem/core/servlets/IndexContentToSolr.java (revision 603009da7fcd67f2b6ae3782edfbd0bb9a98153e)
+++ core/src/main/java/com/adobe/aem/core/servlets/IndexContentToSolr.java (date 1538407326651)
@@ -68,7 +68,8 @@
.getContentPagePath();
String URL = protocol + "://" + serverName + ":" + serverPort
+ "/solr/" + coreName;
- HttpSolrClient server = new HttpSolrClient(URL);
+ final HttpSolrClient.Builder builder = new HttpSolrClient.Builder().withBaseSolrUrl(URL);
+ final HttpSolrClient server = builder.build();
if (indexType.equalsIgnoreCase("indexpages")) {
try {
JSONArray indexPageData = solrSearchService.crawlContent(
Index: core/src/main/java/com/adobe/aem/core/servlets/DeleteIndexesFromSolr.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- core/src/main/java/com/adobe/aem/core/servlets/DeleteIndexesFromSolr.java (revision 603009da7fcd67f2b6ae3782edfbd0bb9a98153e)
+++ core/src/main/java/com/adobe/aem/core/servlets/DeleteIndexesFromSolr.java (date 1538407326664)
@@ -41,7 +41,8 @@
final String coreName = solrConfigurationService.getSolrCoreName();
String URL = protocol + "://" + serverName + ":" + serverPort
+ "/solr/" + coreName;
- HttpSolrClient server = new HttpSolrClient(URL);
+ final HttpSolrClient.Builder builder = new HttpSolrClient.Builder().withBaseSolrUrl(URL);
+ final HttpSolrClient server = builder.build();
try {
server.deleteByQuery("*:*");
server.commit();
Index: pom.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- pom.xml (revision 603009da7fcd67f2b6ae3782edfbd0bb9a98153e)
+++ pom.xml (date 1538407046640)
@@ -486,12 +486,13 @@
<version>1.4</version>
<scope>test</scope>
</dependency>
+ <!-- https://mvnrepository.com/artifact/org.apache.solr/solr-solrj -->
<dependency>
- <groupId>org.apache.servicemix.bundles</groupId>
- <artifactId>org.apache.servicemix.bundles.solr-solrj</artifactId>
- <version>5.4.1_1</version>
- </dependency>
- <dependency>
+ <groupId>org.apache.solr</groupId>
+ <artifactId>solr-solrj</artifactId>
+ <version>7.5.0</version>
+ </dependency>
+ <dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.3.2</version>
Regards,
Peter