code: static String[] computeMappings(String[] mappings, String classpathRoot) {
          if (mappings == null || mappings.length == 0) {
              if (logger.isDebugEnabled()) {
                  logger.debug("Automatic discovery is activated. Looking for definition files in classpath under [{}].",
                          classpathRoot);
              }
  
              ArrayList<String> autoMappings = new ArrayList<>();
  
              try {
                  // Let's scan our resources
                  Collection<String> indices = IndexFinder.findIndexNames(classpathRoot);
                  for (String index : indices) {
                      Collection<String> types = TypeFinder.findTypes(classpathRoot, index);
                      if (types.isEmpty()) {
                          autoMappings.add(index);
                      } else {
                          if (types.size() > 1) {
                              throw new IllegalArgumentException("Only one single type per index is supported. Replace the following " +
                                      types + " by a single _doc type.");
                          }
                          for (String type : types) {
                              autoMappings.add(index);
                          }
                      }
                  }
  
                  return autoMappings.toArray(new String[autoMappings.size()]);
              } catch (IOException |URISyntaxException e) {
                  logger.debug("Automatic discovery does not succeed for finding json files in classpath under " + classpathRoot + ".");
                  logger.trace("", e);
              }
          }
          return mappings;
      }
docs: We use convention over configuration : see https://github.com/dadoonet/spring-elasticsearch/issues/3