Skip to content

Commit 3142d9f

Browse files
Merge pull request #261 from kit-data-manager/development
PR for v1.0.3
2 parents 0ffd900 + 78575d5 commit 3142d9f

File tree

3 files changed

+25
-11
lines changed

3 files changed

+25
-11
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
### Changed
1313

14+
## [1.0.3] - date 2024-11-25
15+
### Fixed
16+
- Properties for messages now containing URLs as before
17+
1418
## [1.0.2] - date 2024-11-22
1519
### Changed
1620
- Update python Docker tag to v3.13
@@ -177,7 +181,8 @@ and mapping of metadata documents delivered by RabbitMQ
177181
- Mapping of metadata documents with Gemma
178182
- Ingest to elasticsearch
179183

180-
[Unreleased]: https://github.com/kit-data-manager/indexing-service/compare/v1.0.2...HEAD
184+
[Unreleased]: https://github.com/kit-data-manager/indexing-service/compare/v1.0.3...HEAD
185+
[1.0.3]: https://github.com/kit-data-manager/indexing-service/compare/v1.0.2...v1.0.3
181186
[1.0.2]: https://github.com/kit-data-manager/indexing-service/compare/v1.0.1...v1.0.2
182187
[1.0.1]: https://github.com/kit-data-manager/indexing-service/compare/v1.0.0...v1.0.1
183188
[1.0.0]: https://github.com/kit-data-manager/indexing-service/compare/v0.9.0...v1.0.0

CITATION.cff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ authors:
1919
title: "Indexing and Mapping Service"
2020
type: software
2121
abstract: Indexing and Mapping Service is a software for (optional) mapping and indexing metadata documents for (elastic)search.
22-
version: 1.0.2
23-
date-released: 2024-11-22
22+
version: 1.0.3
23+
date-released: 2024-11-25
2424
url: "https://github.com/kit-data-manager/indexing-service"
2525
repository-code: "https://github.com/kit-data-manager/indexing-service"
2626
license: Apache-2.0

src/main/java/edu/kit/datamanager/indexer/messagehandler/MetastoreMessageHandler.java

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ public class MetastoreMessageHandler implements IMessageHandler {
6565

6666
public static final String RESOURCE_URL = "resolvingUrl";
6767
public static final String MAPPING_ID = "documentType";
68-
private static final String MAPPING_URL_APPENDIX = "/api/v1/schemas/";
6968

7069
MetastoreMessageHandler(ApplicationProperties configuration, MappingService mappingService, IndexingService indexingService) {
7170
properties = configuration;
@@ -89,13 +88,8 @@ public RESULT handle(BasicMessage message) {
8988
return RESULT.REJECTED;
9089
}
9190

92-
int beginIndex = mappingId.indexOf(MAPPING_URL_APPENDIX);
91+
int beginIndex = mappingId.lastIndexOf("/") + 1;
9392
int endIndex = mappingId.indexOf("?", beginIndex);
94-
if (beginIndex > 0) {
95-
beginIndex += MAPPING_URL_APPENDIX.length();
96-
} else {
97-
beginIndex = 0;
98-
}
9993
if (endIndex < 0) {
10094
endIndex = mappingId.length();
10195
}
@@ -126,7 +120,8 @@ public RESULT handle(BasicMessage message) {
126120
}
127121

128122
String jsonDocument = FileUtils.readFileToString(resultPath.toFile(), StandardCharsets.UTF_8);
129-
elasticsearchService.uploadToElastic(jsonDocument, index, properties.getElasticsearchType(), resourceUrlAsString);
123+
String resourceUrlAsStringWithoutVersion = removeFilterFromUri(resourceUrlAsString);
124+
elasticsearchService.uploadToElastic(jsonDocument, index, properties.getElasticsearchType(), resourceUrlAsStringWithoutVersion);
130125

131126
} catch (URISyntaxException ex) {
132127
String errorMessage = String.format("Error downloading content from '%s': %s", resourceUrlAsString, ex.getMessage());
@@ -148,4 +143,18 @@ public RESULT handle(BasicMessage message) {
148143
public boolean configure() {
149144
return true;
150145
}
146+
147+
/**
148+
* Remove version and other stuff added to the URI.
149+
* @param uri URI of the object.
150+
* @return URI without additional parameter.
151+
*/
152+
public String removeFilterFromUri(String uri) {
153+
String strippedUri = null;
154+
if (uri != null) {
155+
strippedUri = uri.split("\\?", -1)[0];
156+
}
157+
return strippedUri;
158+
}
159+
151160
}

0 commit comments

Comments
 (0)