Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public enum CQLFields implements CQLFieldsInterface {
StacBasicField.OrganisationVocabs.displayField,
null,
null),
id(
uuid(
StacBasicField.UUID.searchField,
StacBasicField.UUID.displayField,
// Make sure if id match, it will show up as the first result
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public Map<String, StacCollectionModel> getAllNoLandGeometry() {
null,
null,
null,
List.of(CQLFields.id.name(), CQLFields.centroid_nocache.name()),
List.of(CQLFields.uuid.name(), CQLFields.centroid_nocache.name()),
null,
null,
null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ public ElasticSearchBase.SearchResult<StacCollectionModel> searchByParameters(Li
should.add(CQLFields.parameter_vocabs.getPropertyEqualToQuery(term));
should.add(CQLFields.organisation_vocabs.getPropertyEqualToQuery(term));
should.add(CQLFields.platform_vocabs.getPropertyEqualToQuery(term));
should.add(CQLFields.id.getPropertyEqualToQuery(term));
should.add(CQLFields.uuid.getPropertyEqualToQuery(term));
// A request to not using acronym in title and description in metadata, hence these
// acronym moved to links, for example NRMN record is mentioned in the link title.
// This is a work-around to the requirement but still allow use of NRMN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,14 +297,14 @@ public void verifyPropertiesParameter() throws IOException {
"516811d7-cd1e-207a-e0440003ba8c79dd.json"
);

ResponseEntity<Collections> collections = testRestTemplate.getForEntity(getBasePath() + "/collections?datetime=../2007-06-05T14:00:00Z&properties=id,title", Collections.class);
ResponseEntity<Collections> collections = testRestTemplate.getForEntity(getBasePath() + "/collections?datetime=../2007-06-05T14:00:00Z&properties=uuid,title", Collections.class);
assertEquals(1, Objects.requireNonNull(collections.getBody()).getCollections().size(), "hit 1, only one record");

assertNotNull(collections.getBody().getCollections().get(0).getId());
assertNotNull(collections.getBody().getCollections().get(0).getTitle());
assertNull(collections.getBody().getCollections().get(0).getDescription());

collections = testRestTemplate.getForEntity(getBasePath() + "/collections?datetime=../2007-06-05T14:00:00Z&properties=id,title,description", Collections.class);
collections = testRestTemplate.getForEntity(getBasePath() + "/collections?datetime=../2007-06-05T14:00:00Z&properties=uuid,title,description", Collections.class);
assertNotNull(Objects.requireNonNull(collections.getBody()).getCollections().get(0).getDescription());
}
/**
Expand Down Expand Up @@ -804,4 +804,22 @@ public void verifyIBoundaryFunctionWorks() throws IOException {
assertEquals(1, Objects.requireNonNull(collections.getBody()).getCollections().size(), "hit 1");
assertEquals("516811d7-cd1e-207a-e0440003ba8c79dd", Objects.requireNonNull(collections.getBody()).getCollections().get(0).getId(), "id correct");
}

@Test
public void verifyUUIDSearchWorks() throws IOException {
super.insertJsonToElasticRecordIndex(
// Will hit Shark Bay
"516811d7-cd1e-207a-e0440003ba8c79dd.json",
// Will hit Central Eastern of Auz marine park, but not Shark Bay
"ae86e2f5-eaaf-459e-a405-e654d85adb9c.json"
);
ResponseEntity<Collections> collections = testRestTemplate.exchange(
getBasePath() + "/collections?filter=uuid='516811d7-cd1e-207a-e0440003ba8c79dd'",
HttpMethod.GET,
null,
new ParameterizedTypeReference<>() {});

assertEquals(1, Objects.requireNonNull(collections.getBody()).getCollections().size(), "hit 1");
assertEquals("516811d7-cd1e-207a-e0440003ba8c79dd", Objects.requireNonNull(collections.getBody()).getCollections().get(0).getId(), "id correct");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public void searchByParametersWithDoubleQuote() {
should.add(CQLFields.parameter_vocabs.getPropertyEqualToQuery(term));
should.add(CQLFields.organisation_vocabs.getPropertyEqualToQuery(term));
should.add(CQLFields.platform_vocabs.getPropertyEqualToQuery(term));
should.add(CQLFields.id.getPropertyEqualToQuery(term));
should.add(CQLFields.uuid.getPropertyEqualToQuery(term));
should.add(BoolQuery.of(b -> b
.should(CQLFields.links_title_contains.getPropertyEqualToQuery(term))
.boost(0.5f) // lower boost to reduce promotion of link-title-only matches
Expand Down Expand Up @@ -166,7 +166,7 @@ public void searchByParametersWithoutDoubleQuote() {
should.add(CQLFields.parameter_vocabs.getPropertyEqualToQuery(term));
should.add(CQLFields.organisation_vocabs.getPropertyEqualToQuery(term));
should.add(CQLFields.platform_vocabs.getPropertyEqualToQuery(term));
should.add(CQLFields.id.getPropertyEqualToQuery(term));
should.add(CQLFields.uuid.getPropertyEqualToQuery(term));
should.add(BoolQuery.of(b -> b
.should(CQLFields.links_title_contains.getPropertyEqualToQuery(term))
.boost(0.5f) // lower boost to reduce promotion of link-title-only matches
Expand Down
Loading