---
metadata:
  - name: generator
    content: Diplodoc Platform v5.54.2
alternate:
  - https://yandex.com/support/direct-commander-new/en/advanced/query-lang.md
  - https://yandex.com/support/direct-commander-new/ru/advanced/query-lang.md
  - href: en/advanced/query-lang.md
    type: text/markdown
    title: Markdown version
  - href: ../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/support/direct-commander-new/en/llms.txt

# Query language

The query language allows you to enter sophisticated object selection criteria, apply various conditions to the field values, and combine them using boolean operators.

#|
||
![](../_assets/video-icon.png)
|
Video tutorial. Query language

{% cut "Watch video" %}

@[](https://runtime.strm.yandex.ru/player/video/vplvdzqfhlgjt64ucmxs?autoplay=0&branding=0&from=documentation&mute=0&redirect_from=ugc)

{% endcut %}

![](../_assets/hspace.png)
||
|#



## How to form a query {#create-query}

Enter your query in the search bar at the bottom of any Direct Commander tab.

![](../_assets/dcql-start.png =650x)

A simple search term consists of three parts:

```no-highlight
= Field Operator Value
```

For example, the query:

```no-highlight
= text ~ lesson 
```

shows all ads containing the word **lesson** in the _Text_ column.

Start entering your search term following the **=** symbol. You can choose field and operator names from the popups.

![](../_assets/dcql-popup.png =500x)

When entering field names and values, please keep in mind:

- The input is not case sensitive.
    
- If the field name or value consists of multiple words separated by spaces, enclose it in quotation marks:
    
    ```no-highlight
    = "Title 1" = "Singing lessons"
    ```
    
- If you need to find a substring that itself contains quotation marks, use the **\\** character:
    
    ```no-highlight
    = "Title 1" = "\"Singing lessons\""
    ```
    
- If you want to specify multiple values, use square brackets:
    
    ```no-highlight
    = "Title 1" = ["learn"; "singing"]
    ```
    
    or
    
    ```no-highlight
    = "Title 1" = [learn singing]
    ```
    
- For fields that may include a fixed number of values (**Placements**, **Moderation**, **Status**, **Priority**, and others), always use the **~** and **!~** operators with square brackets, even when querying a single value.
    
    ![](../_assets/dcql-prefield.png =500x)
    

If the search term was not correctly formulated, the ![](../_assets/green-ok.png) icon in the input field will change to ![](../_assets/red-fail.png) and an error message will appear.

![](../_assets/dcql-error.png =500x)


## Requests containing multiple conditions {#advanced-query}

You can use the `&` (boolean AND) and `|` (boolean OR) operators to make combined queries.

Search term operations are executed strictly from left to right, but the order can be changed by using round brackets. Operations enclosed in brackets take priority over the standard order of operations.

#### **Example 1**
 
:   ```no-highlight
    = Keyword ~ vocal | Keyword ~ coach
    ```
    
    This query returns keywords containing the words _vocal_ or _coach_.

#### **Example 2**
 
:   ```no-highlight
    = Keyword ~ vocal | Keyword ~ coach & Bid > 1
    ```
    
    This search term will return keywords that meet two conditions simultaneously:
    
    1. Contains the word _vocal_ or _coach_.
    1. Has a search bid greater than 1.

#### **Example 3**
 
:   ```no-highlight
    = Keyword ~ vocal | (Keyword ~ coach & Bid > 1)
    ```
    
    This search term will return keywords that meet at least one of the two conditions:
    
    1. Contains the word _vocal_.
    1. Contains the word _coach_ and has a search bid greater than 1.


## Query language operators {#dcql-operators}

#|
||
**Operator** | **Value** | **Example** | **Result**
||
||
~
|
Contains
|
= "Display region" ~ austr
|
Selects ad groups with the **Display region** field containing _Australia_ or _Austria_ (and maybe some other regions also)
||
||
~
|
Contains
|
= "Image" ~ [black white]
|
Selects ads with the **Image** field containing _black_ or _white_ as a substring
||
||
~
|
Contains
|
= "Display scope" ~ [Network]
|
Selects campaigns that have the _Ad networks_ value in the **Display scope** field.
||
||
!~
|
Doesn't contain
|
= "Display region" !~ austr
|
Selects ad groups with the **Display region** field not containing _Australia_ and _Austria_
||
||
!~
|
Doesn't contain
|
= Keyword !~ [vocal coach]
|
Selects keywords with the **Keyword** field not containing the substrings _vocal_ and _coach_
||
||
!~
|
Doesn't contain
|
= Moderation !~ [Pending]
|
Selects ads where the **Moderation** column contains any value except _Pending_.
||
||
\=
|
Equal/match
|
= "Display region" = Australia
|
Selects only groups that have **Display region** set to _Australia_
||
||
\=
|
Equal/match
|
= Number = [111111 222222]
|
The request picks up ads with numbers 111111 and 222222.
||
||
!=
|
Not equal/don't match
|
= "Display region" != Australia
|
Selects groups that have **Display region** different from _Australia_
||
||
!=
|
Not equal/don't match
|
= Number != [111111 222222]
|
The request picks up ads with all numbers except 111111 and 222222.
||
||
\>
|
More
|
= ctr > 0.5
|
Returns keywords with a CTR higher than 0.5
||
||
<
|
Less
|
= ctr < 0.5
|
Selects keywords with a CTR less than 0.5
||
||
\>=
|
More than or equal to
|
= Bid >= 1
|
Returns keywords for which the bid for search is greater than or equal to 1
||
||
<=
|
Less than or equal to
|
= Bid <= 1
|
Returns keywords for which the bid for search is less than or equal to 1
||
||
&
|
Boolean AND in complex search terms
|
= Text ~ singing & Image = microphone
|
Selects ads with text containing the substring _singing_ and an image name containing the substring _microphone_
||
||
\|
|
Boolean OR in complex search terms
|
= Text ~ vocal \| Text ~ coach
|
Selects ads with text containing the substring _vocal_ OR _coach_
||
|#


{% note alert %}

The operators **~** and **!~** can't be used for columns with numeric values.

The operators **>**, **>=**, **<**, and **<=** can only be used for columns with numeric values.

{% endnote %}

<!-- source: en/_includes/footer.md -->
<div width="100%" align="center"> 
<br><br><br>
You can also go to 
<br>



[![](https://yastatic.net/s3/doc-binary/src/support/direct-commander-new/ru/files/log-commander-en.svg)](https://yandex.com/project/commander/new)


</div>

<!--  -->
<!-- endsource: en/_includes/footer.md -->

<!-- source: en/_includes/remove-voting-style.md -->

<!-- endsource: en/_includes/remove-voting-style.md -->
