class SearchConfiguration {

    static SearchConfiguration from(Configuration configuration) throws ConfigurationException {
        String searchOption = configuration.getString("implementation", Implementation.ElasticSearch.name());
        if (searchOption.equalsIgnoreCase(Implementation.ElasticSearch.name())) {
            return elasticSearch();
        }
        if (searchOption.equalsIgnoreCase(Implementation.Scanning.name())) {
            return scanning();
        }
        throw new ConfigurationException(String.format("'implementation' parameter in '%s.properties' should have '%s' or '%s' value",
                SEARCH_CONFIGURATION_NAME,
                Implementation.ElasticSearch.name(),
                Implementation.Scanning.name()));
    }

    public  SearchConfiguration(Implementation implementation);

}