private long count(String structuredQuery, String freeTextQuery, String docType) {
        try {
            docType = StringUtils.isBlank(docTypeOverride) ? docType : docTypeOverride;
            BoolQueryBuilder fq = boolQueryBuilder(structuredQuery, freeTextQuery);
            // The count api has been removed from the Java api, use the search api instead and set
            // size to 0.
            final SearchRequestBuilder srb =
                    elasticSearchClient
                            .prepareSearch(getIndexName(docType))
                            .setQuery(fq)
                            .setTypes(docType)
                            .storedFields("_id")
                            .setSize(0);
            SearchResponse response = srb.get();
            return response.getHits().getTotalHits();
        } catch (ParserException e) {
            throw new TransientException(e.getMessage(), e);
        }
    }
Initializes the indexes templates task_log, message and event, and mappings.
es6-persistence/src/main/java/com/netflix/conductor/es6/dao/index/ElasticSearchDAOV6.java