Here is the query's  i am using

first query returns the parent instance id's based on those parent instance 
is trigirreng the second query.

SearchResponse response = 
elasticClient.prepareSearch("ibdataindex").setTypes("coveredibsa").setQuery(QueryBuilders.termsQuery("SERIAL_NUMBER",
 
serialNo))
  
.setSearchType(SearchType.QUERY_AND_FETCH).addField("PARENT_INSTANCE_ID").setFrom(0)
  .setSize(20000)
  .execute()
.actionGet();
results = response.getHits().hits();
LOGGER.info("The time taken to retrun data serial number search::"+ 
(System.currentTimeMillis()-time1));

String  instanceQueryString = ""; 
int i=0;
for (SearchHit hit : results) {
instanceQueryString =instanceQueryString+" 
"+hit.getFields().get("PARENT_INSTANCE_ID").getValue();


}
 List<Map<String,Object>> hits = new ArrayList<Map<String,Object>>();
//qb = 
QueryBuilders.queryString("PARENT_INSTANCE_ID:("+instanceQueryString+")");
 long time2 = System.currentTimeMillis();
 
if(!instanceQueryString.equals("")){
response = elasticClient.prepareSearch("ibdataindex")
.setTypes("coveredibsa").setQuery(QueryBuilders.termsQuery("PARENT_INSTANCE_ID",serialNo))
   .setSearchType(SearchType.QUERY_AND_FETCH).addFields(coulns.split(","))
     .setFrom(0).setSize(10000)
     .execute()
     .actionGet();

I am using spring task scheduler in which i am passing 250 serial nos as 
batch.

On Thursday, February 27, 2014 8:38:49 AM UTC-8, Jörg Prante wrote:
>
> It would help if you can post the query you use, and how the lines you 
> send correspond to the number of threads, and how you fire off the queries 
> in parallel.
>
> Jörg
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/85442edf-c452-4c04-92af-34c4fc5fa420%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to