When getting the ES client by calling static method Es.getClient() - which
in turn calls static method Es.createClient() to create the client and
populates the corresponding static field if not existing - the
nodesService.closed property of the returned client is true.
When calling static method Es.createClient() directly everything works just
fine.
Which library are you using? To my knowledge, the official Java library
does not have getClient() or createClient() calls
It would be up to your application to control how a client is
created/accessed/persisted. IMHO, an application should maintain a
singleton instance to an Elasticsearch client. And yes, a static member is
persisted for the lifetime of the JVM. PHP is primarily a web-only
language, so many of its concepts relate to the HTTP request lifecycle. Not
so with the JVM, which is far more than HTTP.
Thx for your answer! After being hit by the insight that JVM persists
static members between requests I could easily work around - you just have
to know (as always) ...
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.