title: How to use If Conditionals in NEST Queries Elasticsearch
body: <p>I want to build a NEST query for Elasticsearch depending on the user input that matches this LINQ query</p>
  <p><code>return the elasticSearchDocuments.FirstOrDefault(x=&gt;x.Code.Contains(input) || x.Name.Contains(input) || (x.Code+x.Name).Contains(input))</code></p>
  <p>Name, code are strings fields in the document</p>