@medusajs/search

2.21.2

Patch Changes

  • #16928 494745b8e6b63024e1b7741fe95caa4d03b464b0 Thanks @sradevski! - fix(search): count distinct values instead of documents for deduplicated Medusa Cloud searches, and reject deduplicating by an unknown or array field

  • #16966 aff9d3e847f254bfa36c55c9daa4d6261a4b8e23 Thanks @sradevski! - fix(search): stop the active version cache from undoing an index flip. Setting or invalidating an entry now waits for a refresh in flight to land first, so a refresh that read the database before the flip can no longer drop or roll it back

  • #16930 08f73ec78e17a3a5b6db112290e28f8b3ed79ef6 Thanks @sradevski! - fix(search): stop search index versions from piling up. A reindex drops the versions earlier failed or interrupted rebuilds left above the active one, and a swap drops every version below the new active one except its predecessor, instead of leaving them until the next build

  • Updated dependencies []:

2.21.1

Patch Changes

Which physical index backs a logical index is cached per process, and only the process performing a swap updated its own copy. Another process kept resolving the retired version, so its writes landed somewhere nothing reads and were lost once that version was cleaned up. Writes now resolve the active version fresh, and a read whose cached version has since been dropped resolves again instead of failing.

Also fixes the background refresh latching off after a single failure, which pinned a process to a stale version until the hard TTL expired. That TTL is now 2 minutes rather than 10.

db:migrate now plans a drop for every search index left without a definition, the way it already plans deletions for removed links. It asks which ones to drop before touching them; --execute-all-search drops them all without prompting and --execute-safe-search leaves them alone, mirroring the link flags. Unattended runs with neither flag skip the drops rather than hang on a prompt.

DELETE /admin/search-indexes/:id drops every physical index ever built for an index, along with its versions and sync history, so the next migration recreates it from scratch at version 1. Useful when an index' physical state has drifted past what a reindex can repair.

Available as searchModuleService.deleteIndex, deleteSearchIndexWorkflow, sdk.admin.search.deleteIndex, and a confirmed action in the admin dashboard.

2.21.0

Patch Changes

2.20.1

Patch Changes

2.20.0

Patch Changes

Log seed/reindex progress (count, rate, last key) so large catalogs can be followed.

2.19.0

Patch Changes