Skip to content

feat: Limit number of fields targeted by a regex#67

Closed
Darkheir wants to merge 1 commit into
sekoiafrom
feat/regex_field_limit
Closed

feat: Limit number of fields targeted by a regex#67
Darkheir wants to merge 1 commit into
sekoiafrom
feat/regex_field_limit

Conversation

@Darkheir

Copy link
Copy Markdown
Collaborator

Description

Describe the proposed changes made in this PR.

How was this PR tested?

Describe how you tested this PR.

Copilot AI review requested due to automatic review settings June 18, 2026 08:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a guardrail in the doc-mapper query builder to limit how many distinct fields a single query can target with regex clauses, preventing overly expensive regex-heavy queries from impacting system performance.

Changes:

  • Introduces a MAX_REGEX_QUERY_FIELDS cap and collects targeted regex fields via a QueryAstVisitor.
  • Enforces the cap early in build_query, returning an error when exceeded.
  • Adds unit tests covering rejection/acceptance boundaries for the new limit.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread quickwit/quickwit-doc-mapper/src/query_builder.rs
Comment thread quickwit/quickwit-doc-mapper/src/query_builder.rs
Comment thread quickwit/quickwit-doc-mapper/src/query_builder.rs
@Darkheir Darkheir requested a review from rdettai-sk June 18, 2026 09:00
Signed-off-by: Darkheir <raphael.cohen@sekoia.io>
@Darkheir Darkheir force-pushed the feat/regex_field_limit branch from cf68057 to 94527ad Compare June 18, 2026 09:10
@Darkheir

Copy link
Copy Markdown
Collaborator Author

Closing it in favor of #68

@Darkheir Darkheir closed this Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants