diff --git a/NOTICE b/NOTICE index abadac2e0bc4c53f0900712151e1c71f1cee2ec3..4c408c6e65feaa0b7ffa2b5a434e33d58a3b25d1 100644 --- a/NOTICE +++ b/NOTICE @@ -209,6 +209,7 @@ The following software have components provided under the terms of this license: - Asynchronous Http Client (from ) - Asynchronous Http Client Netty Utils (from ) - AutoValue (from ) +- AutoValue Annotations (from ) - Azure AD Spring Security Integration Spring Boot Starter (from https://github.com/Microsoft/azure-spring-boot) - Azure Metrics Spring Boot Starter (from https://github.com/Microsoft/azure-spring-boot) - BSON (from http://bsonspec.org) @@ -237,6 +238,7 @@ The following software have components provided under the terms of this license: - Elasticsearch: 5.0.0-alpha5 (from https://github.com/elastic/elasticsearch) - Elasticsearch: 5.0.0-alpha5 (from https://github.com/elastic/elasticsearch) - FindBugs-jsr305 (from http://findbugs.sourceforge.net/) +- GSON extensions to the Google HTTP Client Library for Java. (from ) - Google APIs Client Library for Java (from ) - Google APIs Client Library for Java (from ) - Google App Engine extensions to the Google HTTP Client Library for Java. (from ) @@ -381,9 +383,9 @@ The following software have components provided under the terms of this license: - Microsoft Azure Netty HTTP Client Library (from https://github.com/Azure/azure-sdk-for-java) - Microsoft Azure SDK for SQL API of Azure Cosmos DB Service (from https://github.com/Azure/azure-sdk-for-java) - Mockito (from http://mockito.org) -- Mockito (from http://www.mockito.org) - Mockito (from http://mockito.org) - Mockito (from http://mockito.org) +- Mockito (from http://www.mockito.org) - Mojo's Maven plugin for Cobertura (from http://mojo.codehaus.org/cobertura-maven-plugin/) - MongoDB Driver (from http://www.mongodb.org) - MongoDB Java Driver Core (from http://www.mongodb.org) @@ -634,6 +636,8 @@ The following software have components provided under the terms of this license: - Google APIs Client Library for Java (from ) - Google APIs Client Library for Java (from ) - Google Auth Library for Java - Credentials (from ) +- Google Auth Library for Java - Credentials (from ) +- Google Auth Library for Java - OAuth2 HTTP (from ) - Google Auth Library for Java - OAuth2 HTTP (from ) - Hamcrest library (from ) - JDOM (from http://www.jdom.org) @@ -1107,3 +1111,5 @@ The following software have components provided under the terms of this license: - jts-core (from ) - jts-io-common (from ) - xml-apis (from ) + + diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexSchemaServiceImpl.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexSchemaServiceImpl.java index 095b66a84fd8b3174140d0294012e0aa0c025b5e..fb0469356a95978325aa45d9f44b3dd186b308fa 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexSchemaServiceImpl.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexSchemaServiceImpl.java @@ -244,7 +244,11 @@ public class IndexSchemaServiceImpl implements IndexSchemaService { HashMap<String, Object> propertiesMap = new HashMap<>(); for (SchemaItem propertiesItem : schemaItem.getProperties()) { String propertiesItemKind = propertiesItem.getKind(); - String propertiesElasticType = TypeMapper.getIndexerType(propertiesItemKind,ElasticType.TEXT.getValue()); + Object propertiesElasticType = TypeMapper.getIndexerType(propertiesItemKind,ElasticType.TEXT.getValue()); + if(propertiesItem.getProperties() != null){ + HashMap<String, Object> innerProperties = normalizeInnerProperties(propertiesItem); + propertiesElasticType = TypeMapper.getObjectsArrayMapping(propertiesItemKind, innerProperties); + } propertiesMap.put(propertiesItem.getPath(),propertiesElasticType); } return propertiesMap; diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/util/TypeMapper.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/util/TypeMapper.java index 87f32761557c302ce3df29d20faafbdc43417c34..6a9a9dc4c30900a76fa811ac63315bce6358efb0 100644 --- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/util/TypeMapper.java +++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/util/TypeMapper.java @@ -104,7 +104,11 @@ public class TypeMapper { Map<String,Object> type = (Map<String, Object>) indexerType; Map<String, Object> propertiesMap = (Map<String, Object>) type.get(Constants.PROPERTIES); for (Map.Entry<String,Object> entry : propertiesMap.entrySet()){ - entry.setValue(Records.Type.builder().type(entry.getValue().toString()).build()); + if(isMap(entry.getValue())){ + entry.setValue(getDataAttributeIndexerMapping(entry.getValue())); + }else { + entry.setValue(Records.Type.builder().type(entry.getValue().toString()).build()); + } } return indexerType; } diff --git a/provider/indexer-gcp/src/main/java/org/opengroup/osdu/indexer/util/ServiceAccountJwtGcpClientImpl.java b/provider/indexer-gcp/src/main/java/org/opengroup/osdu/indexer/util/ServiceAccountJwtGcpClientImpl.java index 21af7655f45f1dcc797b5b819c2f10120067a3ba..2d0c77f76e1ec4ad097d3dc8a3c921f8a879dabd 100644 --- a/provider/indexer-gcp/src/main/java/org/opengroup/osdu/indexer/util/ServiceAccountJwtGcpClientImpl.java +++ b/provider/indexer-gcp/src/main/java/org/opengroup/osdu/indexer/util/ServiceAccountJwtGcpClientImpl.java @@ -47,6 +47,7 @@ import org.opengroup.osdu.core.common.provider.interfaces.IJwtCache; import org.opengroup.osdu.core.common.provider.interfaces.ITenantFactory; import org.opengroup.osdu.core.common.util.IServiceAccountJwtClient; import org.opengroup.osdu.indexer.config.IndexerConfigurationProperties; +import org.springframework.context.annotation.Primary; import org.springframework.stereotype.Component; import org.springframework.web.context.annotation.RequestScope; @@ -56,6 +57,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +@Primary @Component @RequestScope public class ServiceAccountJwtGcpClientImpl implements IServiceAccountJwtClient { diff --git a/testing/indexer-test-gcp/src/test/java/org/opengroup/osdu/step_definitions/index/record/Steps.java b/testing/indexer-test-gcp/src/test/java/org/opengroup/osdu/step_definitions/index/record/Steps.java index 26060454cb859e06fb80bbfa8a8c0b2d4d8c45a2..ab965b04ed67538ee2e97d80537afd2d87b81839 100644 --- a/testing/indexer-test-gcp/src/test/java/org/opengroup/osdu/step_definitions/index/record/Steps.java +++ b/testing/indexer-test-gcp/src/test/java/org/opengroup/osdu/step_definitions/index/record/Steps.java @@ -53,6 +53,11 @@ public class Steps extends SchemaServiceRecordSteps { super.iShouldGetTheNumberDocumentsForTheIndexInTheElasticSearchWithOutSkippedAttribute(expectedCount, index, skippedAttributes); } + @Then("^I should be able to search (\\d+) record with index \"([^\"]*)\" by tag \"([^\"]*)\" and value \"([^\"]*)\"$") + public void iShouldBeAbleToSearchRecordByTagKeyAndTagValue(int expectedNumber, String index, String tagKey, String tagValue) throws Throwable { + super.iShouldBeAbleToSearchRecordByTagKeyAndTagValue(index, tagKey, tagValue, expectedNumber); + } + @Then("^I should be able search (\\d+) documents for the \"([^\"]*)\" by bounding box query with points \\((-?\\d+), (-?\\d+)\\) and \\((-?\\d+), (-?\\d+)\\) on field \"([^\"]*)\"$") public void i_should_get_the_documents_for_the_in_the_Elastic_Search_by_geoQuery( int expectedCount, String index, Double topLatitude, Double topLongitude, Double bottomLatitude, Double bottomLongitude, String field)