Answers.Body: <p>This is more of a limitation of Craft than Commerce, but it's currently not possible in one query... you'd need to do two and perform some merging/filtering logic.</p>
  
  <p>Consider thumbs-upping/commenting on <a href="https://github.com/craftcms/cms/issues/878" rel="nofollow noreferrer">this feature request</a> which would enable what you're looking for.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-14T04:31:39.117Z
Answers.Text: Great, glad to see it's being proposed. Just upped your proposal on github. Thanks.
Answers.UserDisplayName: user6848
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-14T04:21:13.077Z
Answers.LastActivityDate: 2017-06-14T04:21:13.077Z
Answers.UserDisplayName: Brad Bell
Body: <p>I have Craft Commerce installed, and I wanted to search title against both product title and variant title. I looked up in the database, I noticed that products and variants are of two element types, <code>Commerce_Product</code> and <code>Commerce_Variant</code>. As far as I know, with <code>ElementCriteriaModel</code> you can only query against one element type, like what I have now:</p>
  
  <pre><code>$criteria = craft()-&gt;elements-&gt;getCriteria('Commerce_Product');
  </code></pre>
  
  <p>Is it possible to query against multiple element types in one db call?</p>
  
Tags: <plugin-craftcommerce><craft-features>
Title: How do I query multiple element types in one query
ThreadText: # How do I query multiple element types in one query
  
  (Asked by: username_0 on 2017-06-14)
  
  I have Craft Commerce installed, and I wanted to search title against both product title and variant title. I looked up in the database, I noticed that products and variants are of two element types, `Commerce_Product` and `Commerce_Variant`. As far as I know, with `ElementCriteriaModel` you can only query against one element type, like what I have now:
  
  ```
  $criteria = craft()->elements->getCriteria('Commerce_Product');
  
  ```
  
  Is it possible to query against multiple element types in one db call?
  
  **Tags:** plugin-craftcommerce, craft-features
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-06-14. Score: 0 | Accepted answer
  
  This is more of a limitation of Craft than Commerce, but it's currently not possible in one query... you'd need to do two and perform some merging/filtering logic.
  
  Consider thumbs-upping/commenting on [this feature request](https://github.com/craftcms/cms/issues/878) which would enable what you're looking for.
  
  > **Comments:**
  > **username_0**: Great, glad to see it's being proposed. Just upped your proposal on github. Thanks.  
  
  ---
  
  