diff --git a/en/rum/explorer/data-query.mdx b/en/rum/explorer/data-query.mdx index 4178c5c46..1bb5d3a86 100644 --- a/en/rum/explorer/data-query.mdx +++ b/en/rum/explorer/data-query.mdx @@ -7,44 +7,36 @@ Flashduty RUM Explorer provides powerful search capabilities, allowing you to qu ## 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. +If you are not yet familiar with the query syntax, describe the data you want in plain language and Ask AI writes the query and runs it for you. - - 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. + + Click the **magic wand** icon on the left of the query field, or press ⌘ + Enter in the query field (Ctrl + Enter on Windows and Linux). Ask AI opens right under the query field; while the conversation is empty, it lists a few example questions you can send as they are. - Describe the data you want to find in plain language (Chinese or English supported), then press **Enter** to convert. For example: + Describe the data you want to find in plain language (Chinese or English supported), then press Enter to send. For example: ``` 5xx resource requests from Chrome that took longer than 2 seconds ``` - AI converts it into: + Ask AI first checks the real values in your data, then writes the query into the query field and runs it, for example: ``` browser_name:Chrome resource_status_code:>=500 resource_duration:>2s ``` + + If your description fits another event type better, Ask AI switches to that event type. - - 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. + + When the query finishes, the Ask AI status bar shows how many events matched, and the conversation folds away so you can see the results. Keep refining in plain language (for example, "only 403"), and Ask AI edits the current query; click **Undo** next to the status to restore the query you had before Ask AI wrote to it. -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. +Ask AI writes a standard query (DQL) with the same fields and syntax as manual queries (see below). The time range stays under the page's time picker and is not written into the query. -### 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. - - -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. - - ## Query Basics Queries support two types of terms: @@ -62,30 +54,6 @@ Queries support two types of terms: | `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 ⌘ + Enter from the normal query mode, or Ctrl + Enter on Windows and Linux. - - - - Use natural language, such as “errors on Chrome,” “resource requests slower than 2 seconds,” or “checkout pages from the last 24 hours.” Press Enter to generate a 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. - - - 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. - - - - -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`. - - - -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. - - ## Full-Text Search @@ -226,7 +194,7 @@ The on-error capture switches live in [Remote Configuration](../quickstart/app-m Search for views with loading time over 3 seconds on mobile devices: ``` - device_type:mobile view_loading_time:>3s + device_type:Mobile view_loading_time:>3s ``` diff --git a/zh/rum/explorer/data-query.mdx b/zh/rum/explorer/data-query.mdx index 638923ede..c40fdd3ef 100644 --- a/zh/rum/explorer/data-query.mdx +++ b/zh/rum/explorer/data-query.mdx @@ -8,44 +8,36 @@ Flashduty RUM 查看器提供了强大的检索能力,允许您通过灵活的 ## AI 自然语言查询 -如果您还不熟悉查询语法,可以直接用自然语言描述想要查找的数据,AI 会自动将其转换为查询语句。 +如果您还不熟悉查询语法,可以直接用自然语言描述想要查找的数据,由 Ask AI 写出查询并运行。 - - 点击查询输入框中的**魔法棒**图标进入 AI 自然语言查询模式。进入后输入框边框会高亮,与普通查询模式明确区分。 + + 点击查询框左侧的**魔法棒**图标,或在查询框中按 ⌘ + Enter(Windows 和 Linux 为 Ctrl + Enter)。Ask AI 会出现在查询框正下方;对话为空时,会列出几条可以直接发送的示例问题。 - 用自然语言描述您想查找的数据(支持中英文),然后按**回车**转换。例如: + 用自然语言描述您想查找的数据(支持中英文),按 Enter 发送。例如: ``` 来自 Chrome 浏览器、耗时超过 2 秒的 5xx 资源请求 ``` - AI 会将其转换为: + Ask AI 会先查看数据中的真实取值,再把查询写入查询框并运行,例如: ``` browser_name:Chrome resource_status_code:>=500 resource_duration:>2s ``` + + 如果描述更适合其他事件类型,Ask AI 会自动切换到对应的事件类型。 - - AI 生成对应的查询语句并展示预览。确认无误后点击**应用**,查询立即生效;若结果不理想,可继续修改描述后再次回车重新生成,或点击**撤销**回退到应用前的状态。 + + 查询完成后,Ask AI 的状态栏会显示命中条数,对话自动收起,方便您查看结果。您可以继续用自然语言追问(例如「只看 403」),Ask AI 会在当前查询的基础上修改;点击状态旁的**撤销**,可以恢复到 AI 写入前的查询。 -AI 生成的是标准查询语句(DQL),使用的字段与语法与手动查询完全一致(详见下文)。您无需记住字段名称,AI 会根据当前事件类型自动选择可查询的字段。 +Ask AI 写入的是标准查询语句(DQL),使用的字段与语法和手动查询完全一致(详见下文)。时间范围仍由页面上的时间选择器控制,不会写进查询语句。 -### 追加而非替换 - -当输入框中已有查询条件时,AI 生成的条件会**追加**到现有查询之后,而不会覆盖它。因此您可以在已有查询的基础上,用自然语言逐步补充筛选条件。若当前为空查询,则直接应用生成结果。 - -如果您的描述更适合其他事件类型,AI 会提示切换(如「将切换事件类型为 错误」),并在该事件类型的可查询字段范围内生成查询。 - - -在 AI 输入框中用**自然语言**描述意图即可,无需手写查询语句(如 `browser_name:Chrome`)——直接输入查询语法反而会降低转换准确率。需要精确控制查询条件时,请改用下方的查询语法。 - - ## 查询基础 查询支持两种类型的词项: @@ -63,30 +55,6 @@ AI 生成的是标准查询语句(DQL),使用的字段与语法与手动 | `OR` | 并集:任一词项包含在选定的视图中,需要使用 `()` 包裹起来 | `(error OR warning)` | | `-` | 排除:后面的词项不在视图中 | `error -timeout` | -## AI 自然语言查询 - -如果你不想手写 DQL,可以让 AI 将自然语言请求转换为查询条件。在 RUM 查看器的查询框左侧点击 **AI 自然语言查询** 图标;也可以在普通查询模式下按 ⌘ + Enter(Windows 和 Linux 为 Ctrl + Enter)。 - - - - 用自然语言描述你想查看的数据,例如“Chrome 浏览器上的报错”“耗时超过 2 秒的资源请求”或“过去 24 小时的 checkout 页面”。按 Enter 生成预览。 - - - 预览会显示将要加入的 DQL 条件;当请求更适合其他事件类型或时间范围时,也会显示事件类型或时间范围的变更。 - - - 点击 **应用**、**追加到查询** 或 **切换并应用** 确认变更。应用后,提示消息中会提供 **撤销**,用于恢复应用前的查询、事件类型和时间范围。 - - - - -“最近 1 小时”“昨天”“过去 7 天”等时间表达会更新查看器的时间选择器,不会被写成 `client_time` 等 DQL 条件。性能时长条件仍然属于 DQL,例如 `view_loading_time:>2s`。 - - - -AI 自然语言查询的时间范围最长为 **14 天**。如果请求的范围更长,预览会提示已截取最近 14 天;应用后时间选择器会使用截取后的范围。相对时间范围会改为过去 14 天,绝对时间范围会保留请求的结束时间,并向前取 14 天。 - - ## 全文检索 @@ -227,7 +195,7 @@ session_sampled_for_error:true 检索移动设备上加载时间超过 3 秒的视图: ``` - device_type:mobile view_loading_time:>3s + device_type:Mobile view_loading_time:>3s ```