title: Elastic search wild card search
body: <p>I have used string array to index the field as below:</p>
  
  <pre><code>public class MetaData
  {
      public string[] time { get; set; }
      public string name { get; set; }
  }
  
  
  client.CreateIndex(casedirectory_metadata, c =&gt; c
      AddMapping&lt;object&gt;(m =&gt; m
          .Properties(props =&gt; props
              .String(ps =&gt; ps.Name("time").IndexAnalyzer("keyword"))
              .String(ps =&gt; ps.Name("name").IndexAnalyzer("keyword"))
  )));
  
  MetaData objmetadata = new MetaData();
  objmetadata.time = new string[] { "morning" };
  objmetadata.name = "jhon";
  client.Index&lt;object&gt;((object)objmetadata);
  
  MetaData objmetadata = new MetaData();
  objmetadata.time = new string[] {"this morning", "9.30 am", "evening" };
  objmetadata.name = "jhon rapher";
  client.Index&lt;object&gt;((object)objmetadata);
  </code></pre>
  
  <p>In the above code there are two fields indexed time and name.
  Time field is of string array type and name field if of simple string type<br>
  In Below code wild card characters search is performed with Aggregations on time field</p>
  
  <pre><code>var qryRes1 = client.Search&lt;object&gt;(x =&gt; x
  
                      .Aggregations(ag =&gt; ag
                             .Filter("filter", (flt =&gt; flt
                                 .Filter(f =&gt;
                                 {
                                     FilterContainer filter = null;
                                     filter &amp;= f.Query(qr =&gt; qr.Wildcard(wl =&gt; wl.OnField("time").Value("morning")));
                                     return filter;
                                 })
                                        .Aggregations(agr =&gt; agr
  
                                         .Terms("time", tr =&gt;
                                         {
                                             TermsAggregationDescriptor&lt;object&gt; trmAggDescriptor = new TermsAggregationDescriptor&lt;object&gt;();
                                             trmAggDescriptor.Field("time");
  
                                             trmAggDescriptor.Size(0);
                                             return trmAggDescriptor;
                                         }))))
                           ));
  </code></pre>
  
  <p>above  query should return only Aggregations for "morning" with count 1 because first "morning" is filtered out using wildcard and then Aggregations is applied but it aggregates and returns all the values in time filed.If the same query is applied for field name ="john" it's returning correct result 1 record.  </p>
  
  <p>Do I have to do anything else to do wild card search on array type field? </p>