Answers.Body: <p>You need to specify the <a href="https://github.com/craftcms/cms/issues/1789" rel="nofollow noreferrer">fieldId of the Matrix block you're searching through</a>.</p>
  
  <pre><code>{% set MatrixBlocks = craft.matrixBlocks()
  .fieldId(123)
  .type('metaData')
  .search(query)
  .all() %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-27T21:42:37.977Z
Answers.Text: That did it :) Many thanks.
Answers.UserDisplayName: hvs
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-27T09:02:33.280Z
Answers.LastActivityDate: 2019-08-27T09:02:33.280Z
Answers.UserDisplayName: dmatthams
Body: <p>I want to query a specific matrix block using text search which will search all the searchable fields in that particular block and give me output in the form of blocks that I can further process. </p>
  
  <p>I tried this </p>
  
  <pre><code> {% set MatrixBlocks = craft.matrixBlocks()
  .type('metaData')
  .search(query)
  .all() %}
  </code></pre>
  
  <p>But when I dump each block, I am seeing so many fields and not fields only from the particuar block (metaData) that I want to query.</p>
  
  <p>What is the correct query?</p>
  
Tags: <matrix><queries>
Title: How to search a matrix block with a specific handle?
ThreadText: # How to search a matrix block with a specific handle?
  
  (Asked by: username_0 on 2019-08-23)
  
  I want to query a specific matrix block using text search which will search all the searchable fields in that particular block and give me output in the form of blocks that I can further process.
  
  I tried this
  
  ```
   {% set MatrixBlocks = craft.matrixBlocks()
  .type('metaData')
  .search(query)
  .all() %}
  
  ```
  
  But when I dump each block, I am seeing so many fields and not fields only from the particuar block (metaData) that I want to query.
  
  What is the correct query?
  
  **Tags:** matrix, queries
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-08-27. Score: 2 | Accepted answer
  
  You need to specify the [fieldId of the Matrix block you're searching through](https://github.com/craftcms/cms/issues/1789).
  
  ```
  {% set MatrixBlocks = craft.matrixBlocks()
  .fieldId(123)
  .type('metaData')
  .search(query)
  .all() %}
  
  ```
  
  > **Comments:**
  > **username_0**: That did it :) Many thanks.  
  
  ---
  
  