Hi, when using spring data elasticsearch in a spring boot server, it's hard to decide on how to configure the system (e.g. server uris, username, password, timeouts, etc). On the spring data elasticsearch side, the very first paragraph of the docs (https://docs.spring.io/spring-data/elasticsearch/reference/elasticsearch/clients.html ) state that a configuration bean subclassing org.springframework.data.elasticsearch.client.elc.ElasticsearchConfiguration must be defined

On the springboot side when using autoconfigure, it doesn't use this subclassing system I think, and the only docs I could find are the individual properties documentation ( https://docs.spring.io/spring-boot/appendix/application-properties/index.html#application-properties.data.spring.elasticsearch.connection-timeout )

Should everything use the same system ? Or should the docs be improved to explain why and when one wants to use a configuration system over the other ?

When different systems are used, this has the drawback that if you want to get the configuration at runtime (for example to print the uri of the elasticsearch servers), you need to inject different beans ( ElasticsearchConnectionDetails when using autoconfigure, ClientConfiguration when using springdataelasticsearch elc.ElasticsearchConfiguration ) (or is there anotherway to get the configuration at runtime ?)

I'm sorry I don't know enough to suggest where to add or reword the docs, but at least I can voice my (and potentially others) confusion.

( I saw that having easy to use and clear properties was a goal in https://github.com/spring-projects/spring-boot/commit/e2a355f0035a699730b2ae242cd68544c2d863be so I assume unified configuration or good documentation is a goal too )

Cheers, Jon

Comment From: wilkinsona

There's a section in the Boot's references docs about configuring a connection to Elasticsearch. Is that what you were looking for?

Comment From: jonenst

Wow thanks for the quick response @wilkinsona . The link you gave is great, not sure why I didn't find it with my searches, sorry for the disturbance :( But should there be a paragraph at this place in the docs explaining explaining the difference between springdataelasticsearch org.springframework.data.elasticsearch.client.elc.ElasticsearchConfiguration and what boot's autoconfigure does ? And the difference between ElasticsearchConnectionDetails and elc.ElasticsearchConfiguration? Or if you think this would only make the docs more difficult to understand, you can close this issue. Thanks !

Comment From: wilkinsona

There's a general principle with Boot that it provides conventions and configuration properties for things that would previously have required writing some code. I think this as an example of that. If we were to document the differences here, it would also make sense, in the interests of consistency, that we do so for every piece of auto-configuration and set of configuration properties. We're trying to strike a balance here and my feeling is that this level of detail would make the documentation too verbose and ask the reader to wade through more information than they may need so I'll close this one. Regardless, thanks for the suggestion.