[PR #2364] [MERGED] fix: use ParadeDB v2 fuzzy prefix matching for search #5632

Closed
opened 2026-04-16 13:44:56 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-vikunja/vikunja/pull/2364
Author: @tink-bot
Created: 3/4/2026
Status: Merged
Merged: 3/5/2026
Merged by: @kolaente

Base: mainHead: fix-paradedb-fuzzy-search


📝 Commits (10+)

  • 796648c test: add fixture task with compound word for prefix search testing
  • c5a5d11 test: add web tests for prefix/substring search (#2346)
  • f29c50d test: rewrite MultiFieldSearch tests with SQL output verification
  • 26c1da0 fix: use ParadeDB v2 fuzzy prefix matching for search (#2346)
  • 3edee44 test: call real MultiFieldSearch function and branch on db engine
  • f61b586 test: add task #48 to expected results in feature tests
  • 4296588 ci: upgrade ParadeDB image to support v2 fuzzy search API
  • e6cfc96 test: adjust ParadeDB search tests for fuzzy prefix match broadening
  • 77f8389 test: fix lint and adjust project search test for ParadeDB fuzzy matching
  • 0fff098 test: add result count assertions for ParadeDB search tests

📊 Changes

9 files changed (+210 additions, -72 deletions)

View changed files

📝 .github/workflows/test.yml (+1 -1)
📝 pkg/db/fixtures/tasks.yml (+9 -0)
📝 pkg/db/helpers.go (+9 -16)
📝 pkg/db/helpers_test.go (+81 -28)
📝 pkg/models/project_test.go (+16 -3)
📝 pkg/models/task_collection_test.go (+48 -15)
📝 pkg/models/tasks_test.go (+1 -1)
📝 pkg/webtests/project_test.go (+19 -4)
📝 pkg/webtests/task_collection_test.go (+26 -4)

📄 Description

Summary

Fixes #2346 — ParadeDB search is too strict: searching "landing" does not match a task titled "Landingpages update" because paradedb.match() only does exact token matching.

  • Migrates from legacy @@@ paradedb.match() / paradedb.disjunction_max() to ParadeDB v2 ||| operator with ::pdb.fuzzy(1, t) cast
  • Prefix mode (t) enables "landing" → "landingpages" matching
  • Edit distance of 1 adds single-character typo tolerance
  • ILIKE/LIKE fallback for non-ParadeDB databases is unchanged

Changes

  • pkg/db/helpers.go — Switch MultiFieldSearchWithTableAlias() to v2 fuzzy prefix syntax
  • pkg/db/helpers_test.go — Rewrite tests with proper SQL output verification using builder.NewWriter()
  • pkg/webtests/task_collection_test.go — Add web tests for prefix/substring search behavior
  • pkg/db/fixtures/tasks.yml — Add fixture task with compound word title

Test plan

  • Unit tests verify SQL generation for both ParadeDB and ILIKE paths
  • Web tests verify prefix search ("landing" → "Landingpages update") via ILIKE in SQLite
  • Manual verification with ParadeDB-enabled PostgreSQL instance

🔄 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/go-vikunja/vikunja/pull/2364 **Author:** [@tink-bot](https://github.com/tink-bot) **Created:** 3/4/2026 **Status:** ✅ Merged **Merged:** 3/5/2026 **Merged by:** [@kolaente](https://github.com/kolaente) **Base:** `main` ← **Head:** `fix-paradedb-fuzzy-search` --- ### 📝 Commits (10+) - [`796648c`](https://github.com/go-vikunja/vikunja/commit/796648cd1b12aa7728d7a37078bf41710cba00ef) test: add fixture task with compound word for prefix search testing - [`c5a5d11`](https://github.com/go-vikunja/vikunja/commit/c5a5d11affc44b68746c183bf02467da66c3c065) test: add web tests for prefix/substring search (#2346) - [`f29c50d`](https://github.com/go-vikunja/vikunja/commit/f29c50d2f43d95bce3a63150dd6e946ed3237234) test: rewrite MultiFieldSearch tests with SQL output verification - [`26c1da0`](https://github.com/go-vikunja/vikunja/commit/26c1da0383baa890e9657221feaec86417dcc5bb) fix: use ParadeDB v2 fuzzy prefix matching for search (#2346) - [`3edee44`](https://github.com/go-vikunja/vikunja/commit/3edee4420db18fe963bf1a26b069521b65514ae0) test: call real MultiFieldSearch function and branch on db engine - [`f61b586`](https://github.com/go-vikunja/vikunja/commit/f61b5864d6a1bf271ed7b4ae01a347c646d5925f) test: add task #48 to expected results in feature tests - [`4296588`](https://github.com/go-vikunja/vikunja/commit/4296588780c19657871c5384be88f6c641ff41e4) ci: upgrade ParadeDB image to support v2 fuzzy search API - [`e6cfc96`](https://github.com/go-vikunja/vikunja/commit/e6cfc9610c2a26b321fd23717f3fb9724b2eab2e) test: adjust ParadeDB search tests for fuzzy prefix match broadening - [`77f8389`](https://github.com/go-vikunja/vikunja/commit/77f83899d159947acc0bed0450fe8acd129558fc) test: fix lint and adjust project search test for ParadeDB fuzzy matching - [`0fff098`](https://github.com/go-vikunja/vikunja/commit/0fff098afc3015e9b57a28c42c3703af8f06ecc1) test: add result count assertions for ParadeDB search tests ### 📊 Changes **9 files changed** (+210 additions, -72 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/test.yml` (+1 -1) 📝 `pkg/db/fixtures/tasks.yml` (+9 -0) 📝 `pkg/db/helpers.go` (+9 -16) 📝 `pkg/db/helpers_test.go` (+81 -28) 📝 `pkg/models/project_test.go` (+16 -3) 📝 `pkg/models/task_collection_test.go` (+48 -15) 📝 `pkg/models/tasks_test.go` (+1 -1) 📝 `pkg/webtests/project_test.go` (+19 -4) 📝 `pkg/webtests/task_collection_test.go` (+26 -4) </details> ### 📄 Description ## Summary Fixes #2346 — ParadeDB search is too strict: searching "landing" does not match a task titled "Landingpages update" because `paradedb.match()` only does exact token matching. - Migrates from legacy `@@@ paradedb.match()` / `paradedb.disjunction_max()` to ParadeDB v2 `|||` operator with `::pdb.fuzzy(1, t)` cast - Prefix mode (`t`) enables "landing" → "landingpages" matching - Edit distance of 1 adds single-character typo tolerance - ILIKE/LIKE fallback for non-ParadeDB databases is unchanged ## Changes - `pkg/db/helpers.go` — Switch `MultiFieldSearchWithTableAlias()` to v2 fuzzy prefix syntax - `pkg/db/helpers_test.go` — Rewrite tests with proper SQL output verification using `builder.NewWriter()` - `pkg/webtests/task_collection_test.go` — Add web tests for prefix/substring search behavior - `pkg/db/fixtures/tasks.yml` — Add fixture task with compound word title ## Test plan - [x] Unit tests verify SQL generation for both ParadeDB and ILIKE paths - [x] Web tests verify prefix search ("landing" → "Landingpages update") via ILIKE in SQLite - [ ] Manual verification with ParadeDB-enabled PostgreSQL instance --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-16 13:44:56 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#5632