[PR #5239] [MERGED] Search term negation #6452

Closed
opened 2026-02-05 10:32:41 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/BookStackApp/BookStack/pull/5239
Author: @ssddanbrown
Created: 10/2/2024
Status: Merged
Merged: 10/3/2024
Merged by: @ssddanbrown

Base: developmentHead: search_negation


📝 Commits (4)

  • 177cfd7 Search: Added structure for search term inputs
  • 93c677a Searching: Added negation support to UI and term handling
  • cd84d08 Search: Added exact/filter/tag term negation support
  • 966ff91 Search: Prevented negated terms filling in UI inputs

📊 Changes

12 files changed (+543 additions, -223 deletions)

View changed files

app/Search/Options/ExactSearchOption.php (+13 -0)
app/Search/Options/FilterSearchOption.php (+37 -0)
app/Search/Options/SearchOption.php (+26 -0)
app/Search/Options/TagSearchOption.php (+37 -0)
app/Search/Options/TermSearchOption.php (+11 -0)
app/Search/SearchOptionSet.php (+82 -0)
📝 app/Search/SearchOptions.php (+106 -57)
📝 app/Search/SearchResultsFormatter.php (+3 -2)
📝 app/Search/SearchRunner.php (+100 -119)
📝 resources/views/search/all.blade.php (+23 -25)
📝 tests/Entity/EntitySearchTest.php (+37 -4)
📝 tests/Entity/SearchOptionsTest.php (+68 -16)

📄 Description

Adding negation to search exact terms, filters and tags queries.
Not considering search UI for now, nor normal word terms.

Related to #4536

Doc Updates

  • Document negation ability
  • Add {is_template} filter (missed adding before)
  • Add {sort_by:last_commented} filter (missed adding after #440).

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/BookStackApp/BookStack/pull/5239 **Author:** [@ssddanbrown](https://github.com/ssddanbrown) **Created:** 10/2/2024 **Status:** ✅ Merged **Merged:** 10/3/2024 **Merged by:** [@ssddanbrown](https://github.com/ssddanbrown) **Base:** `development` ← **Head:** `search_negation` --- ### 📝 Commits (4) - [`177cfd7`](https://github.com/BookStackApp/BookStack/commit/177cfd72bf22c78823cc46dc5c44df542f5f1fd2) Search: Added structure for search term inputs - [`93c677a`](https://github.com/BookStackApp/BookStack/commit/93c677a6a955c75318c184d167737836c8c36cd5) Searching: Added negation support to UI and term handling - [`cd84d08`](https://github.com/BookStackApp/BookStack/commit/cd84d08157255dd2464a6dcc257355ffeca21c96) Search: Added exact/filter/tag term negation support - [`966ff91`](https://github.com/BookStackApp/BookStack/commit/966ff9138632a47966c217089f0534ecf262d829) Search: Prevented negated terms filling in UI inputs ### 📊 Changes **12 files changed** (+543 additions, -223 deletions) <details> <summary>View changed files</summary> ➕ `app/Search/Options/ExactSearchOption.php` (+13 -0) ➕ `app/Search/Options/FilterSearchOption.php` (+37 -0) ➕ `app/Search/Options/SearchOption.php` (+26 -0) ➕ `app/Search/Options/TagSearchOption.php` (+37 -0) ➕ `app/Search/Options/TermSearchOption.php` (+11 -0) ➕ `app/Search/SearchOptionSet.php` (+82 -0) 📝 `app/Search/SearchOptions.php` (+106 -57) 📝 `app/Search/SearchResultsFormatter.php` (+3 -2) 📝 `app/Search/SearchRunner.php` (+100 -119) 📝 `resources/views/search/all.blade.php` (+23 -25) 📝 `tests/Entity/EntitySearchTest.php` (+37 -4) 📝 `tests/Entity/SearchOptionsTest.php` (+68 -16) </details> ### 📄 Description Adding negation to search exact terms, filters and tags queries. Not considering search UI for now, nor normal word terms. Related to #4536 ### Doc Updates - Document negation ability - Add `{is_template}` filter (missed adding before) - Add `{sort_by:last_commented}` filter (missed adding after #440). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 10:32:41 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#6452