title: Sitecore Search Template Query
body: <p>I want to query the template of content items in Sitecore so that it returns results if the template of the item matches any of the TemplateID's included in the <code>templates</code> variable. The <code>templates</code> variable contains a pipe separated list of TemplateID's to search for on the content item. </p>
  
  <p>I have tried a few different methods but nothing has provided the result that I am looking for. The below is one such example, I have also tried separating out each template using a split on the templates string and running a foreach loop over the below.</p>
  
  <pre><code>var multiSearchParam = new MultiFieldSearchParam 
  {
      Database = dbName,
      InnerCondition = QueryOccurance.Should
  };
  multiSearchParam.TemplateIds = templates;
  parameters.Add(multiSearchParam);
  </code></pre>
  
  <p>I feel as though there is a problem with the conditions I am using.... When I run this with just a single template ID it works like a charm so it seems to be an issue with querying multiple templates.</p>
  
  <p>Does anyone have any suggestions on what I am doing wrong?</p>