Skip to content

Add exclude/negative search to query log - #8407

Open
mortezamirkar wants to merge 2 commits into
AdguardTeam:masterfrom
mortezamirkar:feature/8171-querylog-exclude-search
Open

Add exclude/negative search to query log#8407
mortezamirkar wants to merge 2 commits into
AdguardTeam:masterfrom
mortezamirkar:feature/8171-querylog-exclude-search

Conversation

@mortezamirkar

Copy link
Copy Markdown

Backend

  • Added negative bool field to searchCriterion struct — when true, match() and quickMatch() invert their result, turning a criterion into an exclusion rule
  • Added exclude URL parameter to GET /querylog — parsed as a ctTerm criterion with negative: true
  • All existing query log tests pass; added 4 new test cases for negative matching

Frontend

  • Single search field that toggles between include (normal) and exclude mode via a magnifier icon button
  • In exclude mode, the search input is highlighted with red border/glow and an "EXCLUDE MODE" badge appears
  • Exclude terms are passed as exclude query parameter to the API; URL is kept in sync via history.replace
  • Added i18n keys for all new UI strings (English)

Usage

  1. Type a domain or client in the search field
  2. Click the magnifier icon to switch to exclude mode (icon turns red)
  3. Results matching the term are excluded
  4. Click the icon again to return to normal include search

m.amirkar added 2 commits June 1, 2026 15:50
Add the ability to exclude entries from query log search results by
passing an  URL parameter alongside . When
is set, entries matching the term are excluded from results.

Key changes:
- Add  field to  struct
- Invert match result when  is true
- Parse  parameter in
- Add comprehensive unit tests

See also AdguardTeam#8171.
- Updated SearchFormValues type with optional 'exclude' field
- Added exclude toggle button to search field in Form.tsx
- Updated getLogsUrlParams to accept 'exclude' parameter
- Added DEFAULT_LOGS_FILTER.exclude field
- Added i18n keys for exclude mode UI strings
- Added CSS styles for exclude toggle, badge, and input highlight
@mortezamirkar mortezamirkar changed the title Adds the ability to exclude domains/clients from query log search results via a toggle button next to the search field. Add exclude/negative search to query log Jun 1, 2026
@mortezamirkar

Copy link
Copy Markdown
Author

Closes #8171

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.

1 participant