class ElasticsearchHelper {

    public String getSearchIndexType(final String indexName, final String bdefActiveIndex, final String tagActiveIndex)
    {
        String searchIndexType;

        if (indexName.equals(bdefActiveIndex))
        {
            searchIndexType = SearchIndexTypeEntity.SearchIndexTypes.BUS_OBJCT_DFNTN.name();
        }
        else if (indexName.equals(tagActiveIndex))
        {
            searchIndexType = SearchIndexTypeEntity.SearchIndexTypes.TAG.name();
        }
        else
        {
            throw new IllegalStateException(String
                .format("Search result index name \"%s\" does not match any of the active search indexes. bdefActiveIndex=%s tagActiveIndex=%s", indexName,
                    bdefActiveIndex, tagActiveIndex));
        }

        return searchIndexType;
    }

}