Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
UPSMF
knowledge-platform
Commits
4fb9a508
Commit
4fb9a508
authored
2 years ago
by
Anil Gupta
Browse files
Options
Download
Patches
Plain Diff
Issue #SB-28950 chore: Updated the elasticsearch version from 6.2.4 to 6.8.22
parent
c0bdc49b
release-5.3.0
AmiableAnil-patch-1
Gcloud_copy
Gcloud_fix
Remove_unwantedCode_Gcloud_fix
bulk-upload-comptenecy-mapping
bulk-upload-excelsheet
bulk-upload-test_excel
bulk_upload
csp-migration
dependabot/maven/platform-core/platform-telemetry/ch.qos.logback-logback-core-1.2.9
dependabot/maven/search-api/search-core/org.apache.httpcomponents-httpclient-4.5.13
knowlg-friday
knowlg-oneclick
local-setup-kube
master
patch-1
patch-2
patch-3
poc_bulk_upload
qs-schema
rahul_bulk_upload_postgres
release-4.10.0
release-4.10.1
release-4.9.0
release-4.9.1
release-5.0.0
release-5.0.1
release-5.1.0
release-5.1.0-content
release-5.2.0
release-5.2.0_RC2
release-5.2.0_RC1
release-5.1.0_RC1
release-5.0.0_RC2
release-5.0.0_RC1
release-4.10.0_RC2
release-4.10.0_RC1
release-4.9.1_RC1
release-4.9.0_RC8
release-4.9.0_RC7
release-4.9.0_RC6
release-4.9.0_RC5
release-4.9.0_RC4
release-4.9.0_RC3
release-4.9.0_RC2
release-4.9.0_RC1
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
pom.xml
+2
-0
pom.xml
search-api/search-core/pom.xml
+2
-2
search-api/search-core/pom.xml
search-api/search-core/src/main/java/org/sunbird/search/client/ElasticSearchUtil.java
+7
-10
...ain/java/org/sunbird/search/client/ElasticSearchUtil.java
vmsetup.sh
+2
-2
vmsetup.sh
with
13 additions
and
14 deletions
+13
-14
pom.xml
+
2
−
0
View file @
4fb9a508
...
...
@@ -16,6 +16,8 @@
<scala.version>
2.11.12
</scala.version>
<scalatest.version>
3.0.8
</scalatest.version>
<fasterxml.jackson.version>
2.9.8
</fasterxml.jackson.version>
<maven.compiler.source>
11
</maven.compiler.source>
<maven.compiler.target>
11
</maven.compiler.target>
</properties>
<modules>
<module>
platform-core
</module>
...
...
This diff is collapsed.
Click to expand it.
search-api/search-core/pom.xml
+
2
−
2
View file @
4fb9a508
...
...
@@ -67,12 +67,12 @@
<dependency>
<groupId>
org.elasticsearch
</groupId>
<artifactId>
elasticsearch
</artifactId>
<version>
6.
2.4
</version>
<version>
6.
8.22
</version>
</dependency>
<dependency>
<groupId>
org.elasticsearch.client
</groupId>
<artifactId>
elasticsearch-rest-high-level-client
</artifactId>
<version>
6.
2.4
</version>
<version>
6.
8.22
</version>
</dependency>
<dependency>
<groupId>
junit
</groupId>
...
...
This diff is collapsed.
Click to expand it.
search-api/search-core/src/main/java/org/sunbird/search/client/ElasticSearchUtil.java
+
7
−
10
View file @
4fb9a508
...
...
@@ -11,14 +11,13 @@ import org.apache.commons.lang3.StringUtils;
import
org.apache.http.HttpHost
;
import
org.apache.http.client.config.RequestConfig
;
import
org.apache.http.util.EntityUtils
;
import
org.elasticsearch.client.RestClientBuilder
;
import
org.elasticsearch.action.support.master.AcknowledgedResponse
;
import
org.elasticsearch.client.*
;
import
org.sunbird.search.util.SearchConstants
;
import
org.sunbird.telemetry.logger.TelemetryManager
;
import
org.elasticsearch.action.ActionListener
;
import
org.elasticsearch.action.admin.indices.create.CreateIndexRequest
;
import
org.elasticsearch.action.admin.indices.create.CreateIndexResponse
;
import
org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest
;
import
org.elasticsearch.action.admin.indices.delete.DeleteIndexResponse
;
import
org.elasticsearch.action.bulk.BulkRequest
;
import
org.elasticsearch.action.bulk.BulkResponse
;
import
org.elasticsearch.action.delete.DeleteRequest
;
...
...
@@ -34,9 +33,6 @@ import org.elasticsearch.action.search.SearchRequest;
import
org.elasticsearch.action.search.SearchResponse
;
import
org.elasticsearch.action.update.UpdateRequest
;
import
org.elasticsearch.action.update.UpdateResponse
;
import
org.elasticsearch.client.Response
;
import
org.elasticsearch.client.RestClient
;
import
org.elasticsearch.client.RestHighLevelClient
;
import
org.elasticsearch.common.settings.Settings
;
import
org.elasticsearch.common.xcontent.XContentType
;
import
org.elasticsearch.index.query.BoolQueryBuilder
;
...
...
@@ -170,9 +166,10 @@ public class ElasticSearchUtil {
createRequest
.
settings
(
Settings
.
builder
().
loadFromSource
(
settings
,
XContentType
.
JSON
));
if
(
StringUtils
.
isNotBlank
(
documentType
)
&&
StringUtils
.
isNotBlank
(
mappings
))
createRequest
.
mapping
(
documentType
,
mappings
,
XContentType
.
JSON
);
CreateIndexResponse
createIndexResponse
=
client
.
indices
().
create
(
createRequest
);
// RequestOptions.Builder options = RequestOptions.DEFAULT.toBuilder();
// CreateIndexResponse createIndexResponse = client.indices().create(createRequest);
response
=
c
reateIndexResponse
.
isAcknowledged
();
response
=
c
lient
.
indices
().
create
(
createRequest
)
.
isAcknowledged
();
}
return
response
;
}
...
...
@@ -228,8 +225,8 @@ public class ElasticSearchUtil {
TelemetryManager
.
log
(
"Deleted Documents by Query"
+
EntityUtils
.
toString
(
response
.
getEntity
()));
}
public
static
void
deleteIndex
(
String
indexName
)
throws
InterruptedException
,
ExecutionException
,
IOException
{
DeleteIndex
Response
response
=
getClient
(
indexName
).
indices
().
delete
(
new
DeleteIndexRequest
(
indexName
));
public
static
void
deleteIndex
(
String
indexName
)
throws
IOException
{
Acknowledged
Response
response
=
getClient
(
indexName
).
indices
().
delete
(
new
DeleteIndexRequest
(
indexName
));
esClient
.
remove
(
indexName
);
TelemetryManager
.
log
(
"Deleted Index"
+
indexName
+
" : "
+
response
.
isAcknowledged
());
}
...
...
This diff is collapsed.
Click to expand it.
vmsetup.sh
+
2
−
2
View file @
4fb9a508
#!/bin/bash
sudo
apt update
sudo
apt
install
redis-server
-y
curl
-O
https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.
3.
2.deb
sudo
dpkg
-i
elasticsearch-6.
3.
2.deb
curl
-O
https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.
8.2
2.deb
sudo
dpkg
-i
elasticsearch-6.
8.2
2.deb
sudo
service elasticsearch start
sudo
service elasticsearch status
# This should go to the test cases - Start
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets