2022-02-08 09:57:45 +01:00
|
|
|
package eu.dnetlib.scholix.api.index;
|
|
|
|
|
2022-02-09 11:33:09 +01:00
|
|
|
import org.apache.commons.lang3.tuple.Pair;
|
2022-02-08 09:57:45 +01:00
|
|
|
import org.elasticsearch.client.RestHighLevelClient;
|
2022-02-09 11:33:09 +01:00
|
|
|
import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate;
|
2022-02-08 09:57:45 +01:00
|
|
|
|
2022-02-09 11:33:09 +01:00
|
|
|
/**
|
|
|
|
* The type Elastic search pool.
|
|
|
|
*/
|
|
|
|
public class ElasticSearchPool extends Pool<Pair<RestHighLevelClient, ElasticsearchRestTemplate>> {
|
2022-02-08 09:57:45 +01:00
|
|
|
|
|
|
|
private final ElasticSearchProperties elasticSearchProperties;
|
|
|
|
|
2022-02-09 11:33:09 +01:00
|
|
|
/**
|
|
|
|
* Instantiates a new Elastic search pool.
|
|
|
|
*
|
|
|
|
* @param elasticSearchProperties the elastic search properties
|
|
|
|
*/
|
2022-02-08 09:57:45 +01:00
|
|
|
public ElasticSearchPool(ElasticSearchProperties elasticSearchProperties){
|
|
|
|
super(elasticSearchProperties, new ElasticSearchClientFactory(elasticSearchProperties));
|
|
|
|
this.elasticSearchProperties = elasticSearchProperties;
|
|
|
|
}
|
|
|
|
|
2022-02-09 11:33:09 +01:00
|
|
|
/**
|
|
|
|
* Gets elastic search properties.
|
|
|
|
*
|
|
|
|
* @return the elastic search properties
|
|
|
|
*/
|
2022-02-08 09:57:45 +01:00
|
|
|
public ElasticSearchProperties getElasticSearchProperties() {
|
|
|
|
return elasticSearchProperties;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|