ES query for huge set of records gives Out Of Memory error

Hi,

In my application, i have huge set of records in ES. I am querying 500000
records and writing to a file, it is working fine. After the file has been
generated, I tried the same query. But the memory is not released because
of the first query, SO i am getting out of memory error.

I have below questions as part of the current scenario;

  1. What kind of query should i use for large set of queries. Currently I
    am using boolenquery and also springESTemplate.
  2. How to release memory after executing query

Please help me out. Thanks.

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/69b52e94-f408-407c-98b3-0c837550a8bc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.