test_class.file: oak-search-elastic/src/test/java/org/apache/jackrabbit/oak/plugins/index/elastic/index/ElasticIndexHelperTest.java
test_class.identifier: ElasticIndexHelperTest
test_case.body: @Test
      public void multiRulesWithSamePropertyNames() throws IOException {
          IndexDefinitionBuilder builder = new ElasticIndexDefinitionBuilder();
          IndexDefinitionBuilder.IndexRule indexRuleA = builder.indexRule("typeA");
          indexRuleA.property("foo").type("String");
          IndexDefinitionBuilder.IndexRule indexRuleB = builder.indexRule("typeB");
          indexRuleB.property("foo").type("String").analyzed();
          NodeState nodeState = builder.build();
  
          ElasticIndexDefinition definition =
                  new ElasticIndexDefinition(nodeState, nodeState, "path", "prefix");
  
          CreateIndexRequest request = ElasticIndexHelper.createIndexRequest(ElasticIndexNameHelper.getRemoteIndexName(definition), definition);
  
          ObjectMapper mapper = new ObjectMapper();
          Map<String, Object> jsonMap = mapper.readValue(request.mappings().streamInput(), Map.class);
  
          Map fooMapping = (Map) ((Map) jsonMap.get("properties")).get("foo");
          assertThat(fooMapping.get("type"), is("text"));
          Map fooKeywordMapping = (Map) ((Map) fooMapping.get("fields")).get("keyword");
          assertThat(fooKeywordMapping.get("type"), is("keyword"));
      }
test_case.class_method_signature: ElasticIndexHelperTest.multiRulesWithSamePropertyNames()
test_case.full_signature: @Test public void multiRulesWithSamePropertyNames()
test_case.identifier: multiRulesWithSamePropertyNames
test_case.invocations: indexRule type property indexRule analyzed type property build createIndexRequest getRemoteIndexName readValue streamInput mappings get get assertThat get is get get assertThat get is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void multiRulesWithSamePropertyNames()
focal_class.file: oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/index/ElasticIndexHelper.java
focal_class.identifier: ElasticIndexHelper
focal_class.class_method_signature: ElasticIndexHelper.createIndexRequest(String remoteIndexName, ElasticIndexDefinition indexDefinition)
focal_class.full_signature: public static CreateIndexRequest createIndexRequest(String remoteIndexName, ElasticIndexDefinition indexDefinition)
focal_class.identifier: createIndexRequest
focal_class.modifiers: public static
focal_class.parameters: (String remoteIndexName, ElasticIndexDefinition indexDefinition)
focal_class.return: CreateIndexRequest
focal_class.signature: CreateIndexRequest createIndexRequest(String remoteIndexName, ElasticIndexDefinition indexDefinition)
focal_class.class_method_signature: ElasticIndexHelper.loadSettings(ElasticIndexDefinition indexDefinition)
focal_class.full_signature: private static XContentBuilder loadSettings(ElasticIndexDefinition indexDefinition)
focal_class.identifier: loadSettings
focal_class.modifiers: private static
focal_class.parameters: (ElasticIndexDefinition indexDefinition)
focal_class.return: XContentBuilder
focal_class.signature: XContentBuilder loadSettings(ElasticIndexDefinition indexDefinition)
focal_class.class_method_signature: ElasticIndexHelper.mapInternalProperties(XContentBuilder mappingBuilder)
focal_class.full_signature: private static void mapInternalProperties(XContentBuilder mappingBuilder)
focal_class.identifier: mapInternalProperties
focal_class.modifiers: private static
focal_class.parameters: (XContentBuilder mappingBuilder)
focal_class.return: void
focal_class.signature: void mapInternalProperties(XContentBuilder mappingBuilder)
focal_class.class_method_signature: ElasticIndexHelper.mapIndexRules(ElasticIndexDefinition indexDefinition, XContentBuilder mappingBuilder)
focal_class.full_signature: private static void mapIndexRules(ElasticIndexDefinition indexDefinition, XContentBuilder mappingBuilder)
focal_class.identifier: mapIndexRules
focal_class.modifiers: private static
focal_class.parameters: (ElasticIndexDefinition indexDefinition, XContentBuilder mappingBuilder)
focal_class.return: void
focal_class.signature: void mapIndexRules(ElasticIndexDefinition indexDefinition, XContentBuilder mappingBuilder)
focal_class.class_method_signature: ElasticIndexHelper.checkIndexRules(ElasticIndexDefinition indexDefinition)
focal_class.full_signature: private static void checkIndexRules(ElasticIndexDefinition indexDefinition)
focal_class.identifier: checkIndexRules
focal_class.modifiers: private static
focal_class.parameters: (ElasticIndexDefinition indexDefinition)
focal_class.return: void
focal_class.signature: void checkIndexRules(ElasticIndexDefinition indexDefinition)
focal_method.body: public static CreateIndexRequest createIndexRequest(String remoteIndexName, ElasticIndexDefinition indexDefinition) throws IOException {
          final CreateIndexRequest request = new CreateIndexRequest(remoteIndexName);
  
          // provision settings
          request.settings(loadSettings(indexDefinition));
  
          // provision mappings
          final XContentBuilder mappingBuilder = XContentFactory.jsonBuilder();
          mappingBuilder.startObject();
          {
              mappingBuilder.startObject("properties");
              {
                  mapInternalProperties(mappingBuilder);
                  mapIndexRules(indexDefinition, mappingBuilder);
              }
              mappingBuilder.endObject();
          }
          mappingBuilder.endObject();
          request.mapping(mappingBuilder);
  
          return request;
      }
focal_method.class_method_signature: ElasticIndexHelper.createIndexRequest(String remoteIndexName, ElasticIndexDefinition indexDefinition)
focal_method.full_signature: public static CreateIndexRequest createIndexRequest(String remoteIndexName, ElasticIndexDefinition indexDefinition)
focal_method.identifier: createIndexRequest
focal_method.invocations: settings loadSettings jsonBuilder startObject startObject mapInternalProperties mapIndexRules endObject endObject mapping
focal_method.modifiers: public static
focal_method.parameters: (String remoteIndexName, ElasticIndexDefinition indexDefinition)
focal_method.return: CreateIndexRequest
focal_method.signature: CreateIndexRequest createIndexRequest(String remoteIndexName, ElasticIndexDefinition indexDefinition)