feat/search-all-terms #43

Merged
christian.keller merged 3 commits from feat/search-all-terms into main 2026-10-15 06:39:55 +00:00
No description provided.
christian.keller force-pushed feat/search-all-terms from 2e047e3e47
Some checks failed
/ release (pull_request) Failing after 1m35s
to 7adff7bd2e
Some checks failed
/ release (pull_request) Failing after 1m30s
2026-10-12 11:04:12 +00:00
Compare
@ -62,0 +86,4 @@
val positive = searchField.copy(not = false)
val perTerm = value.filterNotNull().map { singleCondition(positive, it, mappers, dsl, keyAlias) }
val terms = if (searchField.terms == CrudSearchTerms.ANY) DSL.or(perTerm) else DSL.and(perTerm)
return if (searchField.not) terms.not() else terms
Member

Question about how not applies with a list of search terms on an array column, compared to a single search term: is the difference intended?
For a single value, not applies to each element, inside the EXISTS (in valueCondition, line 307). For a list, this line applies it to the whole result, outside the
EXISTS. The same term therefore gives a different result for a String property than for a List<String> property.

Example: @CrudSearchField("keywords", rudSearchType.CONTAINS, not = true) and a book with the keywords {sci, fiction}:

  • "sci" gives exists (... where not (value like '%sci%')): at least one keyword does not contain "sci". The book matches.
  • ["sci"] gives not exists (... where value like '%sci%'): no keyword contains "sci". The book does not match.
Question about how `not` applies with a list of search terms on an array column, compared to a single search term: is the difference intended? For a single value, `not` applies to each element, inside the `EXISTS` (in `valueCondition`, [line 307](https://git.denktmit.tech/DenktMit-OSS/lt-crudular/src/commit/7adff7bd2e3f9020a566a133645dba3281be419b/repo-jooq/src/main/kotlin/de/loosetie/crudular/repo/jooq/internal/SearchConditions.kt#L307)). For a list, this line applies it to the whole result, outside the `EXISTS`. The same term therefore gives a different result for a `String` property than for a `List<String>` property. Example: `@CrudSearchField("keywords", rudSearchType.CONTAINS, not = true)` and a book with the keywords `{sci, fiction}`: - `"sci"` gives `exists (... where not (value like '%sci%'))`: at least one keyword does not contain "sci". The book matches. - `["sci"]` gives `not exists (... where value like '%sci%')`: no keyword contains "sci". The book does not match.
Author
Owner

Good finding. The "not" now works as a real negation, so outside of the condition described by the annotation

Good finding. The "not" now works as a real negation, so outside of the condition described by the annotation
christian.keller marked this conversation as resolved
christian.keller force-pushed feat/search-all-terms from 7adff7bd2e
Some checks failed
/ release (pull_request) Failing after 1m30s
to fd032f295b
All checks were successful
/ release (pull_request) Successful in 1m54s
2026-10-14 13:00:09 +00:00
Compare
fix(search): invert the whole result set with not
All checks were successful
/ release (pull_request) Successful in 1m33s
640e26e4b3
`not` on a search field now gives `NOT (condition)` for each type of
field. Before, the `not` of an array or a descriptor collection inverted
the condition on each element in the EXISTS, and a reference ignored the
`not`. One value and a list of terms now give the same result. An empty
array is a result of a `not` search.
christian.keller deleted branch feat/search-all-terms 2026-10-15 06:39:55 +00:00
christian.keller referenced this pull request from a commit 2026-10-15 06:39:56 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
3 participants
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
DenktMit-OSS/lt-crudular!43
No description provided.