> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flashcat.cloud/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.

## 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`     |

## 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
```

## 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>
