use of org.opensextant.util.SolrProxy in project Xponents by OpenSextant.
the class SolrGazetteer method initialize.
/**
* Initialize. Cascading env variables: First use value from constructor,
* then opensextant.solr, then solr.solr.home
*
* @throws ConfigException
* Signals that a configuration exception has occurred.
*/
private void initialize(String solrHome) throws ConfigException {
solr = solrHome != null ? new SolrProxy(solrHome, "gazetteer") : new SolrProxy("gazetteer");
params.set(CommonParams.Q, "*:*");
params.set(CommonParams.FL, "id,name,cc,adm1,adm2,feat_class,feat_code,geo,place_id,name_bias,id_bias,name_type");
try {
this.countryCodes = loadCountries(solr.getInternalSolrServer());
} catch (SolrServerException loadErr) {
throw new ConfigException("SolrGazetteer is unable to load countries due to Solr error", loadErr);
} catch (IOException ioErr) {
throw new ConfigException("SolrGazetteer is unable to load countries due to IO/file error", ioErr);
}
}
Aggregations