In entries query, is there a way to check if matrix block is used? I would like to get entries if a matrix field is used. Something like this:

{% set query = craft.entries()
    .section('blog')
    .search('myMatrixField|length')
    .limit(10)
 %}
In this specific case, yes. You can filter your entry query by whether a specific matrix field has at least one block like so:

{% set query = craft.entries({
    section: 'blog',
    myMatrixField: ':notempty:',
    limit: 10
}) %}


or for fields that have 0 matrix blocks in the specific field:

{% set query = craft.entries({
    section: 'blog',
    myMatrixField: ':empty:',
    limit: 10
}) %}


However these are the only two values available for this specific field type. You cannot, for example, search for entries with 3 or more blocks.