LinuxForHealth / FHIR

The LinuxForHealth FHIR® Server and related projects
https://linuxforhealth.github.io/FHIR
Apache License 2.0
331 stars 157 forks source link

Support Partial Reindex #2601

Open prb112 opened 3 years ago

prb112 commented 3 years ago

Is your feature request related to a problem? Please describe. The $reindex operation atomically creates and conditionally updates search parameter values in the Search Parameter tables, this may lead to situations where the values tables remove values that are updated.

There should be a better method with partial Reindex.

Describe the solution you'd like

Reindex should consider what is actually updated, and selectively delete the update.

A couple ideas:

  1. What if we re-run the extract for both the old resources and the new resource and then do the delta?
  2. What if we add support to the reindex operation to accept a set of search parameter names and only perform the reindex on those select names.

Either scoped to just new parameters (skip parameter deletion) OR we need to update the persistence layer to avoid deletion of search parameters that aren't being reindexed

Describe alternatives you've considered

Acceptance Criteria

  1. GIVEN [a precondition] AND [another precondition] WHEN [test step] AND [test step] THEN [verification step] AND [verification step]

Additional context For scenarios where we've added a new table / column and rely on reindex to populate these, we're hoping that implementing a feature like this could cut down on the number of deletes we make to the other parameter tables and therefor avoid #1822

lmsurpre commented 3 years ago

Could benefit from #2736