Searching: Exact term negation causes no results #6121

Closed
opened 2026-04-29 14:03:54 +02:00 by danb · 1 comment
Owner

Description

Currently exact search term negation will form a query like this:

and not (`name` like '%API%' or `description` like '%API%' or `text` like '%API%') 

Since the description/text columns are joined in (at least since entity table changes), with either one column or the other, this results in having null values as part of the "not", which then causes a match.

This needs to instead result in a query like:

and not (`name` like '%API%' or (`description` IS NOT NULL AND `description` like '%API%') or (`text` IS NOT NULL AND `text` like '%API%'))

Found while looking into support request 215

### Description Currently exact search term negation will form a query like this: ```sql and not (`name` like '%API%' or `description` like '%API%' or `text` like '%API%') ``` Since the description/text columns are joined in (at least since entity table changes), with either one column or the other, this results in having null values as part of the "not", which then causes a match. This needs to instead result in a query like: ```sql and not (`name` like '%API%' or (`description` IS NOT NULL AND `description` like '%API%') or (`text` IS NOT NULL AND `text` like '%API%')) ``` --- _Found while looking into support request 215_
danb self-assigned this 2026-04-29 14:03:54 +02:00
danb added this to the v26.03.4 milestone 2026-04-29 14:05:04 +02:00
Author
Owner

Closed via fc220dea39

Closed via fc220dea3996785a683b2661a711952f53f8da8d
danb closed this issue 2026-04-29 19:14:27 +02:00
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bookstack/bookstack#6121
No description provided.