1

Where should I close the connection to a client for Elasticsearch? I am using Spring, and I don't want to use the Elasticsearch integration because I want to learn how to do it without first. Should only one client be created for the application? Meaning that it would have singleton scope? Or should it have prototype scope and close the connection for each interaction?

4

1 回答 1

5

You should use one client per application, make it a singleton and close on application shutdown.

于 2013-03-29T23:46:58.690 回答