title: Elasticsearch multiple condition query using java api
body: <p>There are multiple documents containing around 100 fields each. I'd like to perform a  following search trough elasticsearch Java API 5.x:</p>
  
  <p>There are 3 fields I'd like to use for this search i.e. </p>
  
  <pre><code>department
  job
  name
  </code></pre>
  
  <p>I'd like to search the return documents that match fields like "department: D1", "department: D2", "job: J1", "job: J2" "name: N1"</p>
  
  <p>I've been trying to do it this way</p>
  
  <pre><code>String[] departments = ["d1","d2","d3"];
  String[] jobs = ["j1","j2","j3"];
  String[] names = ["n1"];
  
  MultiSearchRequestBuilder requestbuilder; 
  
  requestBuilder.add(client.prepareSearch().setQuery(QueryBuilders.termsQuery("department", departments)));
  requestBuilder.add(client.prepareSearch().setQuery(QueryBuilders.termsQuery("job", jobs)));
  requestBuilder.add(client.prepareSearch().setQuery(QueryBuilders.termsQuery("name", names)));
  
  MultiSearchResponse response = requestBuilder.get();
  </code></pre>
  
  <p>However the queries are executed as if each was an individual query, i.e. in this example when j3 exists in d4, the document with d4 will be matched aswell</p>
  
  <p>How to perform the search the way I mentioned? I've been trying numerous different queries and nothing seems to work, is there something I am missing?</p>