Estoy tratando de conectar una aplicación Spring boot con Elastic Search pero obtengo el siguiente error: Constructor threw exception; nested exception is org.springframework.data.elasticsearch.ElasticsearchException: Error while for indexExists request: org.elasticsearch.action.admin.indices.get.GetIndexRequest
Clase de configuracion:
@Configuration
@EnableElasticsearchRepositories(basePackages = "com.repository")
public class ESConfig extends AbstractElasticsearchConfiguration {
@Override
@Bean
public RestHighLevelClient elasticsearchClient() {
final ClientConfiguration clientConfiguration = ClientConfiguration.builder()
.connectedTo("Servidor de elastic")
.withBasicAuth("user", "password").build();
return RestClients.create(clientConfiguration).rest();
}
}
Entidad :
@Document(indexName = "flight")
public class FlightPositionES {
@Id
private Long id;
private String ident;
private String airGround;
private Double altitude;
private Integer clock;
private String flightId;
private Double groundSpeed;
private Double heading;
private GeoPoint location;
private String aircraftRegistration;
}
Repositorio:
public interface IFlightPositionESRepository extends ElasticsearchCrudRepository<FlightPositionES, Long> {
}