Skip to content

Conversation

@bjp232004
Copy link
Contributor

@bjp232004 bjp232004 commented Sep 16, 2025

PR Type

Documentation


Description

  • Expand syntax guide with match_all examples

  • Add prefix, phrase prefix, regex usage

  • Document case-sensitive and postfix searches

  • Mirror examples for query editor and SQL


Diagram Walkthrough

flowchart LR
  Guide["Syntax guide (logs)"]
  MatchAll["match_all examples"]
  Prefix["Prefix & postfix"]
  Phrase["Phrase prefix"]
  Regex["Regex patterns"]
  Case["Case-sensitive usage"]

  Guide -- "adds" --> MatchAll
  MatchAll -- "includes" --> Prefix
  MatchAll -- "includes" --> Phrase
  MatchAll -- "includes" --> Regex
  MatchAll -- "includes" --> Case
Loading

File Walkthrough

Relevant files
Documentation
SyntaxGuide.vue
Extend logs syntax guide with match_all patterns                 

web/src/plugins/logs/SyntaxGuide.vue

  • Add match_all prefix example ('error*')
  • Add phrase prefix example ('error code*')
  • Add regex-like example ('*code 40*')
  • Add case-sensitive and postfix examples ('traceHits', '*failed')
+60/-0   

@bjp232004 bjp232004 linked an issue Sep 16, 2025 that may be closed by this pull request
@github-actions
Copy link
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Possible Inaccuracy

The examples label wildcard-based searches as "regex" using asterisks (e.g., match_all('code 40')). If the underlying syntax uses simple wildcards rather than full regular expressions, this wording could mislead users. Confirm whether match_all supports true regex or just wildcard/glob patterns and adjust the wording accordingly.

  For regex search use
  <span class="bg-highlight">match_all('*code 40*')</span>
  to match patterns using regular expressions.
</li>
Consistency

"Search terms are case-insensitive" is stated generally, but later an example implies case-sensitive matching with match_all('traceHits'). Clarify whether case sensitivity depends on analyzer/config or quoting, and specify how users can enforce case-sensitive vs. insensitive behavior.

  For inverted index search of value 'error' use
  <span class="bg-highlight">match_all('error')</span>
  in query editor. Search terms are case-insensitive.
</li>
<li>
  For prefix search use
  <span class="bg-highlight">match_all('error*')</span>
  to find all terms starting with 'error'.
</li>
<li>
  For phrase prefix search use
  <span class="bg-highlight">match_all('error code*')</span>
  to find phrases starting with 'error code'.
</li>
<li>
  For regex search use
  <span class="bg-highlight">match_all('*code 40*')</span>
  to match patterns using regular expressions.
</li>
<li>
  For case sensitive search use
  <span class="bg-highlight">match_all('traceHits')</span>
  with exact case matching.
</li>
Escaping Guidance

Examples with spaces (e.g., 'error code*') and special characters would benefit from guidance on quoting and escaping rules, especially for phrase prefix vs. tokenized matching. Consider adding notes on how to escape quotes, asterisks, or reserved characters.

  For phrase prefix search use
  <span class="bg-highlight">match_all('error code*')</span>
  to find phrases starting with 'error code'.
</li>

@github-actions
Copy link
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Correct mislabeled search syntax

Clarify that match_all uses wildcard syntax, not full regular expressions, to avoid
misleading users. Replace "regex" with "wildcard" and consider adding an example
note that * matches any sequence.

web/src/plugins/logs/SyntaxGuide.vue [55-58]

-For regex search use
+For wildcard search use
 <span class="bg-highlight">match_all('*code 40*')</span>
-to match patterns using regular expressions.
+to match patterns using wildcard characters (e.g., `*` for any sequence).
Suggestion importance[1-10]: 7

__

Why: The snippet exists in the new hunk and labeling it "regex" is likely misleading if match_all uses wildcard semantics; rewording reduces user confusion, though impact is moderate documentation accuracy.

Medium
Fix incorrect case-sensitivity claim

If match_all is case-insensitive, this statement is incorrect and will confuse
users. Either remove the claim or explicitly note that exact case matching is not
guaranteed with match_all.

web/src/plugins/logs/SyntaxGuide.vue [60-63]

-For case sensitive search use
-<span class="bg-highlight">match_all('traceHits')</span>
-with exact case matching.
+For case-sensitive search (if supported), use the appropriate function or flag; `match_all('traceHits')` is case-insensitive and will not enforce exact case.
Suggestion importance[1-10]: 6

__

Why: The lines exist and calling out potential inaccuracy about case sensitivity can prevent misleading guidance, but without PR context confirming match_all behavior, the change is advisory rather than definitive.

Low
General
Ensure examples render consistently

Wrap examples with escaped HTML where needed to prevent rendering issues and ensure
consistency; use * inside text blocks only if the frontend sanitizes it
incorrectly. Also add quotes consistently in SQL examples to avoid mismatched
guidance.

web/src/plugins/logs/SyntaxGuide.vue [45-48]

+For prefix search use
+<span class="bg-highlight">match_all('error*')</span>
+to find all terms starting with 'error'.
 
-
Suggestion importance[1-10]: 2

__

Why: The existing code matches the new hunk, but the improved code is identical and the suggestion is vague about actual rendering issues, offering minimal concrete improvement.

Low

@bjp232004 bjp232004 force-pushed the 8472-add-match_all-function-main branch 2 times, most recently from 0694332 to a6b445b Compare September 17, 2025 12:20
@bjp232004 bjp232004 force-pushed the 8472-add-match_all-function-main branch 2 times, most recently from b31399b to 1c4b220 Compare September 18, 2025 04:22
@bjp232004 bjp232004 force-pushed the 8472-add-match_all-function-main branch from 1c4b220 to 342dcb5 Compare September 19, 2025 07:03
@bjp232004 bjp232004 merged commit 817245b into main Sep 19, 2025
30 checks passed
@bjp232004 bjp232004 deleted the 8472-add-match_all-function-main branch September 19, 2025 08:09
YashodhanJoshi1 pushed a commit that referenced this pull request Sep 22, 2025
### **PR Type**
Documentation


___

### **Description**
- Expand syntax guide with match_all examples

- Add prefix, phrase prefix, regex usage

- Document case-sensitive and postfix searches

- Mirror examples for query editor and SQL


___

### Diagram Walkthrough


```mermaid
flowchart LR
  Guide["Syntax guide (logs)"]
  MatchAll["match_all examples"]
  Prefix["Prefix & postfix"]
  Phrase["Phrase prefix"]
  Regex["Regex patterns"]
  Case["Case-sensitive usage"]

  Guide -- "adds" --> MatchAll
  MatchAll -- "includes" --> Prefix
  MatchAll -- "includes" --> Phrase
  MatchAll -- "includes" --> Regex
  MatchAll -- "includes" --> Case
```



<details> <summary><h3> File Walkthrough</h3></summary>

<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Documentation</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>SyntaxGuide.vue</strong><dd><code>Extend logs syntax
guide with match_all patterns</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

web/src/plugins/logs/SyntaxGuide.vue

<ul><li>Add match_all prefix example ('error*')<br> <li> Add phrase
prefix example ('error code*')<br> <li> Add regex-like example ('*code
40*')<br> <li> Add case-sensitive and postfix examples ('traceHits',
'*failed')</ul>


</details>


  </td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8475/files#diff-c6e8bb651fadd2b15b5b97f5b6069a57813fb97cc3d06eef983af4def33e8806">+60/-0</a>&nbsp;
&nbsp; </td>

</tr>
</table></td></tr></tr></tbody></table>

</details>

___
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add match_all function examples to SQL syntax guide

3 participants