> ## Documentation Index
> Fetch the complete documentation index at: https://test-8ad8522e-feat-ai-sre.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Data Query Syntax Guide

> Master Flashduty RUM Explorer search syntax to quickly locate and analyze user data through flexible query conditions.

Flashduty RUM Explorer provides powerful search capabilities, allowing you to quickly locate and analyze RUM data through flexible query syntax. Queries consist of **terms** and **operators**, supporting complex search condition combinations.

## AI natural-language query

If you are not yet familiar with the query syntax, you can describe the data you want to find in plain language, and AI will convert it into a query for you.

<Steps>
  <Step title="Enter AI query">
    Click the **magic wand** icon in the query input to enter AI natural-language query mode. Once active, the input border is highlighted to clearly distinguish it from regular query mode.
  </Step>

  <Step title="Describe your intent">
    Describe the data you want to find in plain language (Chinese or English supported), then press **Enter** to convert. For example:

    ```
    5xx resource requests from Chrome that took longer than 2 seconds
    ```

    AI converts it into:

    ```
    browser_name:Chrome resource_status_code:>=500 resource_duration:>2s
    ```
  </Step>

  <Step title="Preview and apply">
    AI generates the corresponding query and shows a preview. When it looks right, click **Apply** and the query takes effect immediately; if the result is not what you expected, refine your description and press Enter again to regenerate, or click **Undo** to revert to the state before applying.
  </Step>
</Steps>

<Note>
  AI generates a standard query (DQL) using the same fields and syntax as manual queries (see below). You do not need to remember field names — AI automatically picks the queryable fields based on the current event type.
</Note>

### Append instead of replace

When the input already contains query conditions, the AI-generated conditions are **appended** to the existing query rather than overwriting it. This lets you build on an existing query and add filters incrementally in plain language. If the query is currently empty, the generated result is applied directly.

If your description fits a different event type better, AI prompts you to switch (for example, "Switch event type to Errors") and generates the query within that event type's queryable fields.

<Tip>
  Describe your intent in **plain language** in the AI input — there is no need to hand-write query syntax (such as `browser_name:Chrome`), as entering query syntax directly lowers conversion accuracy. When you need precise control over conditions, use the query syntax below instead.
</Tip>

## Query Basics

Queries support two types of terms:

| Type            | Description                                  | Example             |
| --------------- | -------------------------------------------- | ------------------- |
| **Single Term** | A single word                                | `test`, `hello`     |
| **Phrase**      | A group of words surrounded by double quotes | `"hello flashduty"` |

### Boolean Operators

| Operator | Description                                                                   | Example              |
| -------- | ----------------------------------------------------------------------------- | -------------------- |
| `AND`    | Intersection: both terms must be in the selected view (default operator)      | `error AND timeout`  |
| `OR`     | Union: either term is contained in the selected view, must be wrapped in `()` | `(error OR warning)` |
| `-`      | Exclusion: the following term is not in the view                              | `error -timeout`     |

## AI Natural-Language Queries

When you do not want to write DQL by hand, let AI turn a natural-language request into query conditions. In the RUM Explorer query field, click the **AI Natural-Language Query** icon on the left. You can also press <kbd>⌘</kbd> + <kbd>Enter</kbd> from the normal query mode, or <kbd>Ctrl</kbd> + <kbd>Enter</kbd> on Windows and Linux.

<Steps>
  <Step title="Describe what you want to find">
    Use natural language, such as “errors on Chrome,” “resource requests slower than 2 seconds,” or “checkout pages from the last 24 hours.” Press <kbd>Enter</kbd> to generate a preview.
  </Step>

  <Step title="Review the preview">
    The preview shows the DQL condition to add. When the request better fits another event type or time range, it also shows the event-type or time-range change.
  </Step>

  <Step title="Apply or undo">
    Click **Apply**, **Append to Query**, or **Switch and Apply** to confirm the change. After applying it, the confirmation message offers **Undo** to restore the previous query, event type, and time range.
  </Step>
</Steps>

<Note>
  Time expressions such as “last hour,” “yesterday,” and “past 7 days” update the Explorer time picker; they are not written as DQL conditions such as `client_time`. Performance-duration conditions remain DQL, for example `view_loading_time:>2s`.
</Note>

<Note>
  AI natural-language queries support a maximum time range of **14 days**. If the requested range is longer, the preview indicates that it has been truncated to the most recent 14 days; after you apply it, the time picker uses that truncated range. A relative range becomes the past 14 days, while an absolute range keeps the requested end time and starts 14 days earlier.
</Note>

## Full-Text Search

<Warning>
  Full-text search only supports some fields. If no results are found, please switch to field queries.
</Warning>

| Query           | Description                               |
| --------------- | ----------------------------------------- |
| `hello`         | Fields that exactly match `hello`         |
| `hello*`        | Fields that start with `hello`            |
| `*hello`        | Fields that end with `hello`              |
| `*hello*`       | Fields that contain `hello`               |
| `"hello world"` | Fields that exactly match `"hello world"` |

## Escape Special Characters

When searching for field values containing special characters, you need to escape them with backslash `\` or use double quotes.

<Note>
  The following characters are considered special: `:`, `"`, `*`, `-`, `>`, `<`, `,`, `(`, `)`, `[`, `]`, `\` and space
</Note>

## Attribute Search

Use `attribute:term` syntax to search specific attributes:

| Query                     | Description                                   |
| ------------------------- | --------------------------------------------- |
| `browser_name:Chrome`     | Search for browsers with value `Chrome`       |
| `view_name:*/detail`      | Search for view names ending with `/detail`   |
| `-resource_status_code:0` | Search for resources with status code not `0` |
| `os_name:"Mac OS X"`      | Search for OS names with value `"Mac OS X"`   |

## Numeric Search

For numeric type attributes, comparison operators can be used:

| Query                         | Description                                             |
| ----------------------------- | ------------------------------------------------------- |
| `session_error_count:>5`      | Search for sessions with error count greater than `5`   |
| `view_time_spent:>=1.00min`   | Search for views with time spent greater than `1min`    |
| `session_view_count:[2 TO 8]` | Search for sessions with view count between `2` and `8` |

## Complex Query Examples

<Tabs>
  <Tab title="Error Analysis">
    Search for Warning type errors that occurred in the wallet page:

    ```
    error_message:Warning\:* view_url_path:/wallet/*
    ```
  </Tab>

  <Tab title="Performance Analysis">
    Search for views with loading time over 5 seconds that start with `/incident/detail/`:

    ```
    view_loading_time:>=5s view_url_path:/incident/detail/*
    ```
  </Tab>

  <Tab title="Error Requests">
    Search for resources with request type `fetch` or `xhr` and status code not `200`:

    ```
    -resource_status_code:200 resource_type:(fetch OR xhr)
    ```
  </Tab>

  <Tab title="Page Behavior">
    Search for views with URL `/incident` and action count greater than `2` or error count greater than `3`:

    ```
    view_url_path:/incident (view_action_count:>=2 OR view_error_count:>=3)
    ```
  </Tab>
</Tabs>

## WeChat Mini Program-Specific Attributes

For View events collected from the WeChat Mini Program platform, the following queryable attributes are available in addition to the shared `view_*` fields. They help diagnose cold-start latency, `setData` cost, and lifecycle-stage durations:

| Attribute                | Description                               |
| ------------------------ | ----------------------------------------- |
| `view_first_render`      | First-screen render duration              |
| `view_app_launch`        | Mini Program launch duration              |
| `view_loading_time`      | Page load duration                        |
| `view_setdata_count`     | Number of `setData` calls on the page     |
| `view_setdata_duration`  | Cumulative `setData` duration on the page |
| `view_onload_to_onshow`  | Duration between `onLoad` and `onShow`    |
| `view_onshow_to_onready` | Duration between `onShow` and `onReady`   |

For example, to find Mini Program pages with a first-screen render longer than 2 seconds:

```
source:miniprogram view_first_render:>2s
```

## Session Attribute Search

In addition to the fields in the examples above, sessions support the following common queryable attributes, which can also be used for column display, CSV export, and link variables:

| Attribute            | Description                                          |
| -------------------- | ---------------------------------------------------- |
| `session_id`         | Session ID                                           |
| `session_view_count` | Number of views in the session                       |
| `session_has_replay` | Whether the session includes a replay                |
| `rc_version`         | Remote configuration version reported by the session |

`rc_version` corresponds to the published [Remote Configuration](../quickstart/app-management) version of the application, letting you filter sessions by configuration version and evaluate the rollout of a remote configuration release.

## Advanced Search Tips

<AccordionGroup>
  <Accordion title="Time Range Search">
    Perform precise searches combined with time range:

    ```
    view_loading_time:>2s client_time:>1758253826081
    ```
  </Accordion>

  <Accordion title="User Behavior Search">
    Search for user click behavior on the checkout page:

    ```
    action_type:click view_url_path:/checkout/*
    ```
  </Accordion>

  <Accordion title="Device Type Search">
    Search for views with loading time over 3 seconds on mobile devices:

    ```
    device_type:mobile view_loading_time:>3s
    ```
  </Accordion>

  <Accordion title="Geographic Location Search">
    Search for sessions with errors in China region:

    ```
    geo_country:China session_error_count:>0
    ```
  </Accordion>
</AccordionGroup>

## Best Practices

<CardGroup cols={2}>
  <Card title="Use Quotes for Phrases" icon="quote-left">
    Ensure exact matching of multi-word phrases
  </Card>

  <Card title="Use Wildcards Wisely" icon="asterisk">
    Avoid overly broad search conditions
  </Card>

  <Card title="Combine Multiple Conditions" icon="layer-group">
    Build precise queries through AND/OR operators
  </Card>

  <Card title="Use Auto-Complete" icon="keyboard">
    Reduce input errors and improve search accuracy
  </Card>
</CardGroup>

<Tip>
  Save frequently used search conditions to improve efficiency for repeated queries.
</Tip>

## Next Steps

<CardGroup cols={2}>
  <Card title="RUM Explorer Overview" icon="compass" href="./overview">
    Learn about Explorer core features
  </Card>

  <Card title="Distributed Tracing" icon="diagram-project" href="../best-practices/distributed-tracing">
    Learn distributed tracing best practices
  </Card>
</CardGroup>
