Skip to content

Commit

Permalink
Revert "solr upgrade"
Browse files Browse the repository at this point in the history
  • Loading branch information
IsankaSR authored Feb 14, 2022
1 parent 4748204 commit adde64b
Show file tree
Hide file tree
Showing 6 changed files with 616 additions and 607 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import org.apache.solr.common.SolrException.ErrorCode;
import org.apache.solr.common.SolrInputDocument;
import org.apache.solr.core.CoreContainer;
import org.apache.solr.core.NodeConfig;
import org.wso2.carbon.CarbonConstants;
import org.wso2.carbon.base.MultitenantConstants;
import org.wso2.carbon.context.PrivilegedCarbonContext;
Expand All @@ -62,7 +61,6 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.file.Paths;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
Expand Down Expand Up @@ -120,7 +118,7 @@ protected SolrClient() throws IOException {
// commons-io --> file utils
langDir = new File(confDir, "lang");
if (!langDir.exists() && !langDir.mkdirs()) {
throw new IOException("Solr lang directory could not be created! Path: " + langDir);
throw new IOException("Solf lang directory could not be created! Path: " + langDir);
}

// Read the configuration file name and there destination path and stored in filePathMap
Expand All @@ -131,13 +129,10 @@ protected SolrClient() throws IOException {
System.setProperty(SolrConstants.SOLR_HOME_SYSTEM_PROPERTY, solrHome.getPath());

if (solrServerUrl != null && !solrServerUrl.isEmpty()) {
HttpSolrClient.Builder builder = new HttpSolrClient.Builder(solrServerUrl);
this.server = builder.build();
log.info("Http Solr server initiated at: " + solrServerUrl);
this.server = new HttpSolrClient(solrServerUrl);
log.info("Http Sorl server initiated at: " + solrServerUrl);
} else {
NodeConfig nodeConfig = new NodeConfig.NodeConfigBuilder("registry-indexing", Paths.get(solrHome.getPath()))
.build();
CoreContainer coreContainer = new CoreContainer(nodeConfig);
CoreContainer coreContainer = new CoreContainer(solrHome.getPath());
coreContainer.load();
this.server = new EmbeddedSolrServer(coreContainer, solrCore);
log.info("Default Embedded Solr Server Initialized");
Expand Down Expand Up @@ -491,7 +486,7 @@ private void addTenantId(int tenantId, SolrInputDocument solrInputDocument) {
*/
private void addRawContent(String rawContent, SolrInputDocument solrInputDocument) {
if (rawContent != null && StringUtils.isNotEmpty(rawContent)) {
solrInputDocument.addField(IndexingConstants.FIELD_TEXT, rawContent);
solrInputDocument.addField(IndexingConstants.FIELD_TEXT, rawContent, 1.0f);
}
}

Expand All @@ -508,7 +503,7 @@ private void addFieldID(int tenantId, String path, String rawContent, SolrInputD
if (id == null) {
id = IndexingConstants.FIELD_ID + rawContent.hashCode();
}
solrInputDocument.addField(IndexingConstants.FIELD_ID, id);
solrInputDocument.addField(IndexingConstants.FIELD_ID, id, 1.0f);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@
http://wiki.apache.org/solr/SolrAdaptersForLuceneSpatial4
-->
<fieldType name="location_rpt" class="solr.SpatialRecursivePrefixTreeFieldType"
geo="true" distErrPct="0.025" maxDistErr="0.000009" distanceUnits="kilometers" />
geo="true" distErrPct="0.025" maxDistErr="0.000009" units="degrees" />

<!-- Money/currency field type. See http://wiki.apache.org/solr/MoneyFieldType
Parameters:
Expand Down
Loading

0 comments on commit adde64b

Please sign in to comment.