title: How to search with optional data and list data in ElasticsearchRepository?
body: <p>I am using <code>spring-data-elasticsearch</code> and I have a class as follows,</p>
  <pre><code>@Document(indexName = &quot;sample&quot;)
  class Sample {
  
     @Id
     private String id;
     private String n_id;
     private String b_ref;
     private String r_ref;
     private Status status;
  }
  </code></pre>
  <p>Above is persisted to <code>elasticsearch</code>. And I have the following method to find data in it.</p>
  <pre><code>List&lt;Sample&gt; getAll(String n_id, Optional&lt;String&gt; b_ref, Optional&lt;String&gt; r_ref, List&lt;Status&gt; statuses);
  </code></pre>
  <p>But the challenge I am facing is I have 2 <code>Optional</code> fields and 1 <code>List</code> field that need to check if <code>contains</code> the status. I tried multiple ways in <code>ElasticsearchRepository</code> but none of them worked.</p>
  <p>How can I build the query for the above scenario?</p>