Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
cache: 'maven'

- name: Build with Maven
run: mvn -B verify --file pom.xml
run: mvn clean -B verify --file pom.xml

- name: Build Docker Image
uses: docker/build-push-action@v5
Expand Down
29 changes: 14 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@ VOLUME /tmp
ENV MAX_HEAP_PERCENTAGE=70

COPY ./server/target/ogcapi-java-server-*-exec.jar app.jar
ENTRYPOINT [\
"java",\
"-XX:MaxRAMPercentage=${MAX_HEAP_PERCENTAGE}",\
"-Delasticsearch.index.name=${INDEX_NAME}",\
"-Delasticsearch.cloud_optimized_index.name=${CO_INDEX_NAME}",\
"-Delasticsearch.vocabs_index.name=${VOCABS_INDEX_NAME}",\
"-Dapi.host=${HOST}:${PORT}",\
"-Dserver.port=${PORT}",\
"-Delasticsearch.serverUrl=${ELASTIC_URL}",\
"-Delasticsearch.apiKey=${ELASTIC_KEY}",\
"-Ddata-access-service.host=${DAS_HOST}",\
"-Ddata-access-service.secret=${DAS_SECRET}",\
"--enable-preview",\
"-jar",\
"/app.jar"]
ENTRYPOINT ["/bin/sh", "-c", "java \
-XX:MaxRAMPercentage=${MAX_HEAP_PERCENTAGE} \
-Delasticsearch.index.name=${INDEX_NAME} \
-Delasticsearch.cloud_optimized_index.name=${CO_INDEX_NAME} \
-Delasticsearch.vocabs_index.name=${VOCABS_INDEX_NAME} \
-Dapi.host=${HOST}:${PORT} \
-Dserver.port=${PORT} \
-Delasticsearch.serverUrl=${ELASTIC_URL} \
-Delasticsearch.apiKey=${ELASTIC_KEY} \
-Ddata-access-service.host=${DAS_HOST} \
-Ddata-access-service.secret=${DAS_SECRET} \
--enable-preview \
-jar \
/app.jar"]
3 changes: 3 additions & 0 deletions server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,9 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>--enable-preview</argLine>
<systemPropertyVariables>
<spring.profiles.active>test</spring.profiles.active> <!-- e.g., for Spring Boot -->
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ public enum CQLFields implements CQLFieldsInterface {
CQLElasticSetting.score.getSetting(),
CQLElasticSetting.score.getSetting(),
null,
(order) -> new SortOptions.Builder().field(f -> f.field(CQLElasticSetting.score.getSetting()).order(order))
(order) -> new SortOptions.Builder()
.field(f -> f.field(CQLElasticSetting.score.getSetting()).order(order))
),
// Rank score is an internal calculated score, it is different from the one use by ElasticSearch,
// @see es-indexer RankingService
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ public ElasticSearchBase.SearchResult<StacCollectionModel> searchByParameters(Li
}
}
catch(Exception e) {
log.warn("Error parsing score assume null", e);
// OK to ignore as accept null as the value
}
// Get the search after
Expand Down
2 changes: 1 addition & 1 deletion server/src/main/resources/log4j2-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</Console>
</Appenders>
<Loggers>
<Logger name="au.org.aodn.esindexer" level="debug" additivity="false">
<Logger name="au.org.aodn.ogcapi" level="debug" additivity="false">
<AppenderRef ref="DevConsole"/>
</Logger>
<Root level="info">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import co.elastic.clients.elasticsearch._types.query_dsl.QueryBuilders;
import co.elastic.clients.elasticsearch.core.*;
import co.elastic.clients.elasticsearch.core.bulk.BulkResponseItem;
import co.elastic.clients.elasticsearch.core.search.Hit;
import co.elastic.clients.elasticsearch.indices.CreateIndexRequest;
import co.elastic.clients.transport.rest_client.RestClientTransport;
import com.fasterxml.jackson.databind.JsonNode;
Expand Down Expand Up @@ -241,6 +242,11 @@ protected void insertJsonToElasticIndex(String index, String[] filenames) throws
logger.debug(response.toString());

assertEquals(filenames.length, response.hits().hits().size(), "Number of docs stored is correct");
for (Hit<ObjectNode> hit : response.hits().hits()) {
if(hit.source() != null) {
logger.debug("Stored the following id {}", hit.source().get("id"));
}
}
}

protected void insertJsonToElasticRecordIndex(String... filenames) throws IOException {
Expand Down
Loading
Loading