title: Value in list of values exists in elastic field list nest c#
body: <p>Could not solve the issue with elastic.</p>
  
  <p>Given: </p>
  
  <ol>
  <li>List with colors:
  <code>var colors_to_filter = ["red", "blue", "black"];</code></li>
  <li>Field colors in elasticsearch: <code>colors: ["green", "red", "black"]</code></li>
  </ol>
  
  <p>Task:</p>
  
  <p>Get all products from elasticsearch with colors which has been defined in <code>colors_to_filter</code> list.
  If any of the colors in <code>colors_to_filter</code> exists in elasticsearch <code>colors</code> field, return this product.</p>
  
  <p>My current code which is not working:
  (Take a look at this line):<br>
     <code>.Bool(bl =&gt; bl.Filter(fl =&gt; fl.Terms( tr =&gt; tr.Field(fs =&gt; fs.Sizes.Suffix("keyword")).Terms(sizesList))</code></p>
  
  <pre><code>  .Aggregations(a =&gt; a.Terms(sizesAggName, tt =&gt; tt.Field(o =&gt; o.Sizes.Suffix("keyword")))
                                  .Max(priceAggNameMax, st =&gt; st.Field(o =&gt; o.SalePrice)))
    .TrackTotalHits()
    .Sort(p =&gt; GetSortType(sortType))
    .Index(GetIndexName())
    .From(from)
    .Size(size)
    .Query(q =&gt; q.Bool(b =&gt; GetQuery(mainCategory, subCategory, subSubcategory, term)))
    .PostFilter( ppf =&gt; ppf
    .Bool(bl =&gt; bl.Filter(fl =&gt; fl.Terms( tr =&gt; tr.Field(fs =&gt; fs.Sizes.Suffix("keyword")).Terms(sizesList))
    &amp;&amp; ppf.Range(r =&gt; {
                 r = r.Field(f =&gt; f.SalePrice);
                 if (minPrice &gt; 0) r = r.GreaterThanOrEquals((double)minPrice);
                 if (maxPrice &gt; 0) r = r.LessThanOrEquals((double)maxPrice);
                 return r;
    })))));
  
  </code></pre>