Could some one pls tell me the difference
between searchRequestBuilder.execute() and
searchRequestBuilder.execute().actionget()
I'm trying to execute a n Elastic Search query using the Java API.
My query does a match all and then appends a filter to it and is executed
using the below line of code:
*long timeInMillisBefore = new GregorianCalendar().getTimeInMillis();
*
*SearchResponse response = searchRequestBuilder.execute().actionget()
* long timeInMillisAfter = new GregorianCalendar().getTimeInMillis();
The execution takes about 449 milliseconds if i do a *timeInMillisAfter - *timeInMillisBefore
.
response.getTook() gives 12 milliseconds.
As i add more fields, about 332, the execution takes about 2462 seconds and
response.getTook() gives 21 milliseconds.
Apparently its the execution of the actionGet() method that is taking so
much time. I have no idea why this method takes so much time.
Also, if this method is responsible for loading the JSON response in java
objects, then i dont need tht. I can do with a JSON response as well.
Could some one pls throw light on this.
Took is the time used by Elasticsearch to run the query on all shards.
The response need then to be send back to the user. I think this is the extra time you see.
Execute is asynchronous. ActionGet wait for the answer.
--
David
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
Could some one pls tell me the difference between searchRequestBuilder.execute() and searchRequestBuilder.execute().actionget()
I'm trying to execute a n Elastic Search query using the Java API.
My query does a match all and then appends a filter to it and is executed using the below line of code:
long timeInMillisBefore = new GregorianCalendar().getTimeInMillis();
SearchResponse response = searchRequestBuilder.execute().actionget()
long timeInMillisAfter = new GregorianCalendar().getTimeInMillis();
The execution takes about 449 milliseconds if i do a timeInMillisAfter - timeInMillisBefore .
response.getTook() gives 12 milliseconds.
As i add more fields, about 332, the execution takes about 2462 seconds and response.getTook() gives 21 milliseconds.
Apparently its the execution of the actionGet() method that is taking so much time. I have no idea why this method takes so much time.
Also, if this method is responsible for loading the JSON response in java objects, then i dont need tht. I can do with a JSON response as well.
Could some one pls throw light on this.
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.