From a90c2f3d9239cf7bf9e3121b63a27a4f2742422d Mon Sep 17 00:00:00 2001
From: Neelesh Thakur <NThakur4@slb.com>
Date: Wed, 17 Feb 2021 15:47:51 -0600
Subject: [PATCH] enable keyword indexing support for text

---
 .../service/IndexerMappingServiceImpl.java    | 43 +++++---------
 .../indexer/service/IndexerServiceImpl.java   |  3 +-
 .../service/StorageIndexerPayloadMapper.java  | 10 +++-
 .../osdu/indexer/util/TypeMapper.java         | 56 ++++++++++++++++---
 .../features/indexrecord/IndexRecord.feature  |  4 +-
 .../indexRecord-schema-service.feature        |  4 +-
 6 files changed, 77 insertions(+), 43 deletions(-)

diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexerMappingServiceImpl.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexerMappingServiceImpl.java
index 332fcb496..c1c69058c 100644
--- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexerMappingServiceImpl.java
+++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexerMappingServiceImpl.java
@@ -39,16 +39,14 @@ import org.elasticsearch.index.reindex.UpdateByQueryRequest;
 import com.google.gson.Gson;
 import org.opengroup.osdu.core.common.model.http.AppException;
 import org.opengroup.osdu.core.common.Constants;
-import org.opengroup.osdu.core.common.model.indexer.DEAnalyzerType;
-import org.opengroup.osdu.core.common.model.indexer.ElasticType;
-import org.opengroup.osdu.core.common.model.search.RecordMetaAttribute;
 import org.opengroup.osdu.core.common.search.Preconditions;
 import org.opengroup.osdu.core.common.model.indexer.IndexSchema;
-import org.opengroup.osdu.core.common.model.indexer.Records;
 import org.opengroup.osdu.core.common.logging.JaxRsDpsLog;
 import org.opengroup.osdu.indexer.config.IndexerConfigurationProperties;
 import org.opengroup.osdu.indexer.util.ElasticClientHandler;
+import org.opengroup.osdu.indexer.util.TypeMapper;
 import org.springframework.stereotype.Service;
+
 import javax.inject.Inject;
 
 @Service
@@ -62,7 +60,7 @@ public class IndexerMappingServiceImpl extends MappingServiceImpl implements Ind
     private ElasticClientHandler elasticClientHandler;
     private TimeValue REQUEST_TIMEOUT = TimeValue.timeValueMinutes(1);
 
-    
+
     /**
      * Create a new type in Elasticsearch
      *
@@ -114,25 +112,14 @@ public class IndexerMappingServiceImpl extends MappingServiceImpl implements Ind
         // meta  attribute
         Map<String, Object> metaMapping = new HashMap<>();
         for (Map.Entry<String, Object> entry : schema.getMetaSchema().entrySet()) {
-            String key = entry.getKey();
-            if (key.equals(RecordMetaAttribute.ACL.getValue()) || key.equals(RecordMetaAttribute.LEGAL.getValue()) || key.equals(RecordMetaAttribute.ANCESTRY.getValue()) || key.equals(RecordMetaAttribute.INDEX_STATUS.getValue())) {
-                metaMapping.put(key, entry.getValue());
-            } else {
-                metaMapping.put(key, Records.Type.builder().type(entry.getValue().toString()).build());
-            }
+            metaMapping.put(entry.getKey(), TypeMapper.getMetaAttributeIndexerMapping(entry.getKey()));
         }
 
         // data-source attributes
         Map<String, Object> dataMapping = new HashMap<>();
         if (schema.getDataSchema() != null) {
             for (Map.Entry<String, String> entry : schema.getDataSchema().entrySet()) {
-                // Apply de_indexer_analyzer and de_search_analyzer to TEXT field
-                if (configurationProperties.isPreDemo() && ElasticType.TEXT.getValue().equalsIgnoreCase(entry.getValue())) {
-                    log.info(String.format("indexing %s with custom analyzer", entry.getKey()));
-                    dataMapping.put(entry.getKey(), Records.Analyzer.builder().type(entry.getValue()).analyzer(DEAnalyzerType.INDEXER_ANALYZER.getValue()).search_analyzer(DEAnalyzerType.SEARCH_ANALYZER.getValue()).build());
-                } else {
-                    dataMapping.put(entry.getKey(), Records.Type.builder().type(entry.getValue()).build());
-                }
+                dataMapping.put(entry.getKey(), TypeMapper.getDataAttributeIndexerMapping(entry.getValue()));
             }
 
             // inner properties.data.properties block
@@ -162,7 +149,7 @@ public class IndexerMappingServiceImpl extends MappingServiceImpl implements Ind
             }
         }
     }
-    
+
     private boolean updateMappingToEnableKeywordIndexingForField(RestHighLevelClient client, Set<String> indicesSet, String fieldName) throws IOException {
         String[] indices = indicesSet.toArray(new String[indicesSet.size()]);
         Map<String, Map<String, Map<String, FieldMappingMetaData>>> indexMappingMap = getIndexFieldMap(new String[]{"data."+fieldName}, client, indices);
@@ -195,14 +182,14 @@ public class IndexerMappingServiceImpl extends MappingServiceImpl implements Ind
                     }
                 }
             }
-            	
+
             return indexMappingMap;
         } catch (ElasticsearchException e) {
             log.error(String.format("Failed to get indices: %s. | Error: %s", Arrays.toString(indices), e));
             throw new AppException(HttpStatus.SC_INTERNAL_SERVER_ERROR, "Elastic error", "Error getting indices.", String.format("Failed to get indices error: %s", Arrays.toString(indices)));
         }
     }
-    
+
     private boolean updateMappingForAllIndicesOfSameTypeToEnableKeywordIndexingForField(RestHighLevelClient client, String index, Map<String, Map<String, FieldMappingMetaData>> indexMapping, String fieldName) throws IOException {
         PutMappingRequest request = new PutMappingRequest(index);
         String type = indexMapping.keySet().iterator().next();
@@ -210,7 +197,7 @@ public class IndexerMappingServiceImpl extends MappingServiceImpl implements Ind
         	log.error(String.format("Could not find type of the mappings for index: %s.", index));
             return false;
         }
-        
+
         request.type(type);
         request.timeout(REQUEST_TIMEOUT);
         Map<String, FieldMappingMetaData> metaData = indexMapping.get(type);
@@ -225,7 +212,7 @@ public class IndexerMappingServiceImpl extends MappingServiceImpl implements Ind
             log.error(String.format("Could not find field: %s in the mapping of index: %s.", fieldName, index));
             return false;
         }
-        
+
         //Index the field with additional keyword type
         Map<String, Object> keywordMap = new HashMap<>();
         keywordMap.put(Constants.TYPE, "keyword");
@@ -241,22 +228,22 @@ public class IndexerMappingServiceImpl extends MappingServiceImpl implements Ind
         data.put(Constants.DATA,mapping);
         Map<String, Object> properties = new HashMap<>();
         properties.put(Constants.PROPERTIES, data);
-        
+
         request.source(new Gson().toJson(properties), XContentType.JSON);
 
         try {
             AcknowledgedResponse response = client.indices().putMapping(request, RequestOptions.DEFAULT);
             boolean isIndicesUpdated = updateIndices(client, index);
             return response.isAcknowledged() && isIndicesUpdated;
-            	
+
         } catch (Exception e) {
             log.error(String.format("Could not update mapping of index: %s. | Error: %s", index, e));
             return false;
         }
     }
-    
+
     private boolean updateIndices(RestHighLevelClient client, String index) throws IOException {
-        UpdateByQueryRequest request = new UpdateByQueryRequest(index); 
+        UpdateByQueryRequest request = new UpdateByQueryRequest(index);
         request.setConflicts("proceed");
         BulkByScrollResponse response = client.updateByQuery(request, RequestOptions.DEFAULT);
         if(!response.getBulkFailures().isEmpty()) {
@@ -265,7 +252,7 @@ public class IndexerMappingServiceImpl extends MappingServiceImpl implements Ind
         }
 		return true;
     }
-    
+
     /**
      * Create a new type in Elasticsearch
      *
diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexerServiceImpl.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexerServiceImpl.java
index e77ef8f09..196c56526 100644
--- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexerServiceImpl.java
+++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/IndexerServiceImpl.java
@@ -16,6 +16,7 @@ package org.opengroup.osdu.indexer.service;
 
 import com.google.gson.Gson;
 
+import com.google.gson.GsonBuilder;
 import org.apache.http.HttpStatus;
 import org.elasticsearch.ElasticsearchStatusException;
 import org.elasticsearch.action.bulk.BulkItemResponse;
@@ -64,7 +65,7 @@ public class IndexerServiceImpl implements IndexerService {
 
     private static final List<RestStatus> RETRY_ELASTIC_EXCEPTION = new ArrayList<>(Arrays.asList(RestStatus.TOO_MANY_REQUESTS, RestStatus.BAD_GATEWAY, RestStatus.SERVICE_UNAVAILABLE));
 
-    private final Gson gson = new Gson();
+    private final Gson gson = new GsonBuilder().serializeNulls().create();
 
     @Inject
     private JaxRsDpsLog jaxRsDpsLog;
diff --git a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/StorageIndexerPayloadMapper.java b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/StorageIndexerPayloadMapper.java
index fba62bb8a..7ac887012 100644
--- a/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/StorageIndexerPayloadMapper.java
+++ b/indexer-core/src/main/java/org/opengroup/osdu/indexer/service/StorageIndexerPayloadMapper.java
@@ -37,10 +37,10 @@ public class StorageIndexerPayloadMapper {
 
             Object value = getPropertyValue(recordId, storageRecordData, name);
 
-            if (value == null) continue;
-
             ElasticType elasticType = ElasticType.forValue(entry.getValue());
 
+            if (value == null && !nullIndexedValueSupported(elasticType)) continue;
+
             switch (elasticType) {
                 case KEYWORD:
                 case KEYWORD_ARRAY:
@@ -88,7 +88,7 @@ public class StorageIndexerPayloadMapper {
                     this.attributeParsingService.tryParseGeopoint(recordId, name, storageRecordData, dataMap);
                     break;
                 case GEO_SHAPE:
-                    this.attributeParsingService.tryParseGeojson(recordId,  name,  value, dataMap);
+                    this.attributeParsingService.tryParseGeojson(recordId, name, value, dataMap);
                     break;
                 case NESTED:
                 case OBJECT:
@@ -123,4 +123,8 @@ public class StorageIndexerPayloadMapper {
         }
         return null;
     }
+
+    private boolean nullIndexedValueSupported(ElasticType type) {
+        return type == ElasticType.TEXT;
+    }
 }
\ No newline at end of file
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 2f7c9b7c0..a893e1274 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
@@ -22,6 +22,7 @@ import org.opengroup.osdu.core.common.model.indexer.StorageType;
 import org.opengroup.osdu.core.common.model.search.RecordMetaAttribute;
 
 import org.apache.commons.lang3.StringUtils;
+
 import java.util.HashMap;
 import java.util.Map;
 
@@ -64,22 +65,45 @@ public class TypeMapper {
         storageToIndexerType.put(StorageType.GEO_SHAPE.getValue(), ElasticType.GEO_SHAPE.getValue());
     }
 
-
     public static String getIndexerType(String storageType) {
-        String indexedType = storageToIndexerType.getOrDefault(storageType, null);
-        if (indexedType != null && indexedType.endsWith("_array")) {
-            return StringUtils.substringBefore(indexedType, "_");
-        }
-        return indexedType;
+        return storageToIndexerType.getOrDefault(storageType, null);
     }
 
     public static Object getIndexerType(RecordMetaAttribute attribute) {
         return metaAttributeIndexerType.getOrDefault(attribute.getValue(), null);
     }
 
+    public static Object getMetaAttributeIndexerMapping(String key) {
+        if (key.equals(RecordMetaAttribute.ACL.getValue())
+                || key.equals(RecordMetaAttribute.LEGAL.getValue()) || key.equals(RecordMetaAttribute.ANCESTRY.getValue()) || key.equals(RecordMetaAttribute.INDEX_STATUS.getValue())) {
+            return metaAttributeIndexerType.get(key);
+        }
+        return Records.Type.builder().type(metaAttributeIndexerType.get(key).toString()).build();
+    }
+
+    public static Object getDataAttributeIndexerMapping(String indexerType) {
+        if (ElasticType.TEXT.getValue().equalsIgnoreCase(indexerType)) {
+            return getTextIndexerMapping();
+        }
+
+        if (isArray(indexerType)) {
+            return Records.Type.builder().type(getArrayMemberType(indexerType)).build();
+        }
+
+        return Records.Type.builder().type(indexerType).build();
+    }
+
+    private static boolean isArray(String indexerType) {
+        return indexerType != null && indexerType.endsWith("_array");
+    }
+
+    private static String getArrayMemberType(String indexerType) {
+        return StringUtils.substringBefore(indexerType, "_");
+    }
+
     private static Object getAclIndexerMapping() {
         Map<String, Object> aclRoleMapping = new HashMap<>();
-        aclRoleMapping.put(AclRole.VIEWERS.getValue() , Records.Type.builder().type(ElasticType.KEYWORD.getValue()).build());
+        aclRoleMapping.put(AclRole.VIEWERS.getValue(), Records.Type.builder().type(ElasticType.KEYWORD.getValue()).build());
         aclRoleMapping.put(AclRole.OWNERS.getValue(), Records.Type.builder().type(ElasticType.KEYWORD.getValue()).build());
 
         Map<String, Object> aclProperties = new HashMap<>();
@@ -121,4 +145,22 @@ public class TypeMapper {
 
         return indexStatusProperties;
     }
+
+    private static Object getTextIndexerMapping() {
+        Map<String, Object> fieldIndexTypeMap = getKeywordMap();
+        Map<String, Object> textMap = new HashMap<>();
+        textMap.put("type", "text");
+        textMap.put("fields", fieldIndexTypeMap);
+        return textMap;
+    }
+
+    private static Map<String, Object> getKeywordMap() {
+        Map<String, Object> keywordMap = new HashMap<>();
+        keywordMap.put("type", "keyword");
+        keywordMap.put("ignore_above", 256);
+        keywordMap.put("null_value", "null");
+        Map<String, Object> fieldIndexTypeMap = new HashMap<>();
+        fieldIndexTypeMap.put("keyword", keywordMap);
+        return fieldIndexTypeMap;
+    }
 }
\ No newline at end of file
diff --git a/testing/indexer-test-core/src/main/resources/features/indexrecord/IndexRecord.feature b/testing/indexer-test-core/src/main/resources/features/indexrecord/IndexRecord.feature
index c281ec4a0..a06fa2efc 100644
--- a/testing/indexer-test-core/src/main/resources/features/indexrecord/IndexRecord.feature
+++ b/testing/indexer-test-core/src/main/resources/features/indexrecord/IndexRecord.feature
@@ -15,8 +15,8 @@ Feature: Indexing of the documents
 
     Examples:
       | kind                                      | recordFile        | number | index                                     | type   | acl                                    | mapping                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
-      | "tenant1:testindex<timestamp>:well:1.0.0" | "index_records_1" | 5      | "tenant1-testindex<timestamp>-well-1.0.0" | "well" | "data.default.viewers@tenant1" | "{"mappings":{"well":{"dynamic":"false","properties":{"acl":{"properties":{"owners":{"type":"keyword"},"viewers":{"type":"keyword"}}},"ancestry":{"properties":{"parents":{"type":"keyword"}}},"data":{"properties":{"Basin":{"type":"text"},"Country":{"type":"text"},"County":{"type":"text"},"EmptyAttribute":{"type":"text"},"Established":{"type":"date"},"Field":{"type":"text"},"Location":{"type":"geo_point"},"OriginalOperator":{"type":"text"},"Rank":{"type":"integer"},"Score":{"type":"integer"},"State":{"type":"text"},"WellName":{"type":"text"},"WellStatus":{"type":"text"},"WellType":{"type":"text"},"DblArray":{"type":"double"}}},"id":{"type":"keyword"},"index":{"properties":{"lastUpdateTime":{"type":"date"},"statusCode":{"type":"integer"},"trace":{"type":"text"}}},"kind":{"type":"keyword"},"legal":{"properties":{"legaltags":{"type":"keyword"},"otherRelevantDataCountries":{"type":"keyword"},"status":{"type":"keyword"}}},"namespace":{"type":"keyword"},"type":{"type":"keyword"},"version":{"type":"long"},"x-acl":{"type":"keyword"}}}}}" |
-      | "tenant1:testindex<timestamp>:well:3.0.0" | "index_records_1" | 5      | "tenant1-testindex<timestamp>-well-3.0.0" | "well" | "data.default.viewers@tenant1" | "{"mappings":{"well":{"dynamic":"false","properties":{"acl":{"properties":{"owners":{"type":"keyword"},"viewers":{"type":"keyword"}}},"ancestry":{"properties":{"parents":{"type":"keyword"}}},"data":{"properties":{"Basin":{"type":"text"},"Country":{"type":"text"},"County":{"type":"text"},"EmptyAttribute":{"type":"text"},"Established":{"type":"date"},"Field":{"type":"text"},"Location":{"type":"geo_point"},"OriginalOperator":{"type":"text"},"Rank":{"type":"integer"},"Score":{"type":"integer"},"State":{"type":"text"},"WellName":{"type":"text"},"WellStatus":{"type":"text"},"WellType":{"type":"text"},"DblArray":{"type":"double"}}},"id":{"type":"keyword"},"index":{"properties":{"lastUpdateTime":{"type":"date"},"statusCode":{"type":"integer"},"trace":{"type":"text"}}},"kind":{"type":"keyword"},"legal":{"properties":{"legaltags":{"type":"keyword"},"otherRelevantDataCountries":{"type":"keyword"},"status":{"type":"keyword"}}},"namespace":{"type":"keyword"},"type":{"type":"keyword"},"version":{"type":"long"},"x-acl":{"type":"keyword"}}}}}" |
+      | "tenant1:testindex<timestamp>:well:1.0.0" | "index_records_1" | 5      | "tenant1-testindex<timestamp>-well-1.0.0" | "well" | "data.default.viewers@tenant1" | "{"mappings":{"well":{"dynamic":"false","properties":{"acl":{"properties":{"owners":{"type":"keyword"},"viewers":{"type":"keyword"}}},"ancestry":{"properties":{"parents":{"type":"keyword"}}},"data":{"properties":{"Basin":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Country":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"County":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"EmptyAttribute":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Established":{"type":"date"},"Field":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Location":{"type":"geo_point"},"OriginalOperator":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Rank":{"type":"integer"},"Score":{"type":"integer"},"State":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"WellName":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"WellStatus":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"WellType":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"DblArray":{"type":"double"}}},"id":{"type":"keyword"},"index":{"properties":{"lastUpdateTime":{"type":"date"},"statusCode":{"type":"integer"},"trace":{"type":"text"}}},"kind":{"type":"keyword"},"legal":{"properties":{"legaltags":{"type":"keyword"},"otherRelevantDataCountries":{"type":"keyword"},"status":{"type":"keyword"}}},"namespace":{"type":"keyword"},"type":{"type":"keyword"},"version":{"type":"long"},"x-acl":{"type":"keyword"}}}}}" |
+      | "tenant1:testindex<timestamp>:well:3.0.0" | "index_records_1" | 5      | "tenant1-testindex<timestamp>-well-3.0.0" | "well" | "data.default.viewers@tenant1" | "{"mappings":{"well":{"dynamic":"false","properties":{"acl":{"properties":{"owners":{"type":"keyword"},"viewers":{"type":"keyword"}}},"ancestry":{"properties":{"parents":{"type":"keyword"}}},"data":{"properties":{"Basin":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Country":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"County":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"EmptyAttribute":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Established":{"type":"date"},"Field":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Location":{"type":"geo_point"},"OriginalOperator":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Rank":{"type":"integer"},"Score":{"type":"integer"},"State":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"WellName":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"WellStatus":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"WellType":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"DblArray":{"type":"double"}}},"id":{"type":"keyword"},"index":{"properties":{"lastUpdateTime":{"type":"date"},"statusCode":{"type":"integer"},"trace":{"type":"text"}}},"kind":{"type":"keyword"},"legal":{"properties":{"legaltags":{"type":"keyword"},"otherRelevantDataCountries":{"type":"keyword"},"status":{"type":"keyword"}}},"namespace":{"type":"keyword"},"type":{"type":"keyword"},"version":{"type":"long"},"x-acl":{"type":"keyword"}}}}}" |
 
   Scenario Outline: Ingest the record and Index in the Elastic Search with bad attribute
     When I ingest records with the <recordFile> with <acl> for a given <kind>
diff --git a/testing/indexer-test-core/src/main/resources/features/indexrecord/indexRecord-schema-service.feature b/testing/indexer-test-core/src/main/resources/features/indexrecord/indexRecord-schema-service.feature
index 4152a5325..9a340f29a 100644
--- a/testing/indexer-test-core/src/main/resources/features/indexrecord/indexRecord-schema-service.feature
+++ b/testing/indexer-test-core/src/main/resources/features/indexrecord/indexRecord-schema-service.feature
@@ -15,8 +15,8 @@ Feature: Indexing of the documents
 
     Examples:
       | kind                                             | recordFile               | number | index                                            | type              | acl                            | mapping                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
-      | "tenant1:indexer-int-test:sample-schema-1:1.0.4" | "index_records_1" | 5      | "tenant1-indexer-int-test-sample-schema-1-1.0.4" | "sample-schema-1" | "data.default.viewers@tenant1" | "{"mappings":{"well":{"dynamic":"false","properties":{"acl":{"properties":{"owners":{"type":"keyword"},"viewers":{"type":"keyword"}}},"ancestry":{"properties":{"parents":{"type":"keyword"}}},"data":{"properties":{"Basin":{"type":"text"},"Country":{"type":"text"},"County":{"type":"text"},"EmptyAttribute":{"type":"text"},"Established":{"type":"date"},"Field":{"type":"text"},"Location":{"type":"geo_point"},"OriginalOperator":{"type":"text"},"Rank":{"type":"integer"},"Score":{"type":"integer"},"State":{"type":"text"},"WellName":{"type":"text"},"WellStatus":{"type":"text"},"WellType":{"type":"text"},"DblArray":{"type":"double"}}},"id":{"type":"keyword"},"index":{"properties":{"lastUpdateTime":{"type":"date"},"statusCode":{"type":"integer"},"trace":{"type":"text"}}},"kind":{"type":"keyword"},"legal":{"properties":{"legaltags":{"type":"keyword"},"otherRelevantDataCountries":{"type":"keyword"},"status":{"type":"keyword"}}},"namespace":{"type":"keyword"},"type":{"type":"keyword"},"version":{"type":"long"},"x-acl":{"type":"keyword"}}}}}" |
-      | "tenant1:indexer-int-test:sample-schema-3:1.0.4" | "index_records_1" | 5      | "tenant1-indexer-int-test-sample-schema-3-1.0.4" | "sample-schema-3" | "data.default.viewers@tenant1" | "{"mappings":{"well":{"dynamic":"false","properties":{"acl":{"properties":{"owners":{"type":"keyword"},"viewers":{"type":"keyword"}}},"ancestry":{"properties":{"parents":{"type":"keyword"}}},"data":{"properties":{"Basin":{"type":"text"},"Country":{"type":"text"},"County":{"type":"text"},"EmptyAttribute":{"type":"text"},"Established":{"type":"date"},"Field":{"type":"text"},"Location":{"type":"geo_point"},"OriginalOperator":{"type":"text"},"Rank":{"type":"integer"},"Score":{"type":"integer"},"State":{"type":"text"},"WellName":{"type":"text"},"WellStatus":{"type":"text"},"WellType":{"type":"text"},"DblArray":{"type":"double"}}},"id":{"type":"keyword"},"index":{"properties":{"lastUpdateTime":{"type":"date"},"statusCode":{"type":"integer"},"trace":{"type":"text"}}},"kind":{"type":"keyword"},"legal":{"properties":{"legaltags":{"type":"keyword"},"otherRelevantDataCountries":{"type":"keyword"},"status":{"type":"keyword"}}},"namespace":{"type":"keyword"},"type":{"type":"keyword"},"version":{"type":"long"},"x-acl":{"type":"keyword"}}}}}" |
+      | "tenant1:indexer-int-test:sample-schema-1:1.0.4" | "index_records_schema_1" | 5      | "tenant1-indexer-int-test-sample-schema-1-1.0.4" | "sample-schema-1" | "data.default.viewers@tenant1" | "{"mappings":{"well":{"dynamic":"false","properties":{"acl":{"properties":{"owners":{"type":"keyword"},"viewers":{"type":"keyword"}}},"ancestry":{"properties":{"parents":{"type":"keyword"}}},"data":{"properties":{"Basin":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Country":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"County":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"EmptyAttribute":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Established":{"type":"date"},"Field":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Location":{"type":"geo_point"},"OriginalOperator":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Rank":{"type":"integer"},"Score":{"type":"integer"},"State":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"WellName":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"WellStatus":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"WellType":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"DblArray":{"type":"double"}}},"id":{"type":"keyword"},"index":{"properties":{"lastUpdateTime":{"type":"date"},"statusCode":{"type":"integer"},"trace":{"type":"text"}}},"kind":{"type":"keyword"},"legal":{"properties":{"legaltags":{"type":"keyword"},"otherRelevantDataCountries":{"type":"keyword"},"status":{"type":"keyword"}}},"namespace":{"type":"keyword"},"type":{"type":"keyword"},"version":{"type":"long"},"x-acl":{"type":"keyword"}}}}}" |
+      | "tenant1:indexer-int-test:sample-schema-3:1.0.4" | "index_records_schema_1" | 5      | "tenant1-indexer-int-test-sample-schema-3-1.0.4" | "sample-schema-3" | "data.default.viewers@tenant1" | "{"mappings":{"well":{"dynamic":"false","properties":{"acl":{"properties":{"owners":{"type":"keyword"},"viewers":{"type":"keyword"}}},"ancestry":{"properties":{"parents":{"type":"keyword"}}},"data":{"properties":{"Basin":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Country":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"County":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"EmptyAttribute":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Established":{"type":"date"},"Field":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Location":{"type":"geo_point"},"OriginalOperator":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"Rank":{"type":"integer"},"Score":{"type":"integer"},"State":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"WellName":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"WellStatus":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"WellType":{"type":"text","fields":{"keyword":{"type":"keyword","null_value":"null","ignore_above":256}}},"DblArray":{"type":"double"}}},"id":{"type":"keyword"},"index":{"properties":{"lastUpdateTime":{"type":"date"},"statusCode":{"type":"integer"},"trace":{"type":"text"}}},"kind":{"type":"keyword"},"legal":{"properties":{"legaltags":{"type":"keyword"},"otherRelevantDataCountries":{"type":"keyword"},"status":{"type":"keyword"}}},"namespace":{"type":"keyword"},"type":{"type":"keyword"},"version":{"type":"long"},"x-acl":{"type":"keyword"}}}}}" |
 
   Scenario Outline: Ingest the record and Index in the Elastic Search with bad attribute
     When I ingest records with the <recordFile> with <acl> for a given <kind>
-- 
GitLab