title: Performance of Terms Query with many elements
body: <p>I'm planning to use a <code>Terms Query</code> with many terms (depending on the case up to 40-50k terms) in all my queries.</p>
  
  <p>These terms will be fetched from another index using lookup as explained <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-terms-query.html#query-dsl-terms-lookup" rel="noreferrer">here</a>. Elasticsearch takes them internally, so at least they won't go through the wire, but the query itself looks quite heavy.</p>
  
  <p>I was wondering if the query performance will be fine. Anyway I'm planning to do a stress test, but not sure if this is going to escalate well. Someone had experience with these kind of queries or knows how Elasticsearch deals with them internally?</p>
  
  <p>Thank you!</p>