Skip to content

[POS FTS] 1: Add FTS schema, model, and feature flag#16594

Merged
joshheald merged 2 commits intotrunkfrom
pos/fts-1-schema-model-flag
Feb 5, 2026
Merged

[POS FTS] 1: Add FTS schema, model, and feature flag#16594
joshheald merged 2 commits intotrunkfrom
pos/fts-1-schema-model-flag

Conversation

@joshheald
Copy link
Contributor

@joshheald joshheald commented Jan 30, 2026

Part of: WOOMOB-2109
Merge after #16592

Description

Full Text Search requires a virtual table to make the reverse index for the search lookups. This PR adds that table and a model for us to fetch results into.

This is our first migration after adding FTS – it's worth installing from trunk, doing a full sync, and then updating to this PR (or a later one) over the top to trigger that migration.

The FTS5 table uses UNINDEXED columns for siteID, itemType, itemID, and parentProductID. These are stored and queryable but will not form part of FTS searches, they're just so we can find the correct underlying model. Only searchable_text participates in FTS matching.

Test Steps

  • Verify the migration creates the pos_search_fts table

  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

Add the foundation for FTS-based search in Point of Sale:

- V002FTSSearch migration creating pos_search_fts FTS5 virtual table
  with UNINDEXED metadata columns (siteID, itemType, itemID,
  parentProductID)
- POSSearchIndex model for decoding FTS search results
- GRDBManager: register migration, handle FTS5 shadow tables in reset
- pointOfSaleFTSSearch feature flag (alpha + local dev)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@dangermattic
Copy link
Collaborator

dangermattic commented Jan 30, 2026

1 Warning
⚠️ This PR is assigned to the milestone 24.1. This milestone is due in less than 2 days.
Please make sure to get it merged by then or assign it to a milestone with a later deadline.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Jan 30, 2026

App Icon📲 You can test the changes from this Pull Request in WooCommerce iOS Prototype by scanning the QR code below to install the corresponding build.

App NameWooCommerce iOS Prototype
Build Numberpr16594-ae3b392
Version24.0
Bundle IDcom.automattic.alpha.woocommerce
Commitae3b392
Installation URL1542picamhjdo
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

Copy link
Contributor Author

@joshheald joshheald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes needed

Base automatically changed from pos/fts-0-prep-fixes to trunk February 2, 2026 05:15
@joshheald joshheald requested a review from staskus February 4, 2026 15:39
@joshheald joshheald marked this pull request as ready for review February 4, 2026 16:00
@joshheald joshheald modified the milestones: 24.0 ❄️, 24.1 Feb 4, 2026
Copy link
Contributor

@staskus staskus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The start looks good. The pos_search_fts table gets created. I did some reading around FTS + GRDB to make sure I understand if it's built correctly.

Left an optional comment.

}

private static func createSearchFTSTable(_ db: Database) throws {
try db.execute(sql: """
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I understand, GRDB also allows to define the same virtual table creation in Swift-API.

        try db.create(virtualTable: "pos_search_fts", using: FTS5()) { t in
            t.column("searchable_text")
            t.column("siteID").notIndexed()
            t.column("itemType").notIndexed()
            t.column("itemID").notIndexed()
            t.column("parentProductID").notIndexed()
        }

@wpmobilebot
Copy link
Collaborator

🤖 Build Failure Analysis

This build has failures. Claude has analyzed them - check the build annotations for details.

@joshheald joshheald merged commit baedb37 into trunk Feb 5, 2026
13 checks passed
@joshheald joshheald deleted the pos/fts-1-schema-model-flag branch February 5, 2026 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: POS type: enhancement A request for an enhancement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants