Created
April 22, 2011 08:25
-
-
Save lukas-vlcek/936267 to your computer and use it in GitHub Desktop.
Different API for the same timeout ?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// set timeout in actionGet() | |
IndexResponse indexResponse = ElasticSearchClient.getClient().prepareIndex() | |
.setIndex(_myIndexName_) | |
.setType(_myType_) | |
.setId(_myID_) | |
.setSource(_someContent_) | |
.execute() | |
.actionGet(5000); // <-- timeout set here | |
// using setTimeout | |
IndexResponse indexResponse = ElasticSearchClient.getClient().prepareIndex() | |
.setIndex(_myIndexName_) | |
.setType(_myType_) | |
.setId(_myID_) | |
.setSource(_someContent_) | |
.setTimeout( new TimeValue(5000) ) // <-- timeout set here | |
.execute() | |
.actionGet(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment