[Expert Finder] Move experts from unstructured JSON toward a relational model#3295
Closed
nicktytarenko wants to merge 11 commits intomainfrom
Closed
Conversation
Introduce canonical Expert rows (keyed by email) and SearchExpert membership for expert lists per ExpertSearch.
One-off / operational command to copy legacy expert_results JSON into Expert and SearchExpert rows, with dry-run support for safe rollout.
Align finder flow with relational experts: persist/replace search experts, parse markdown table into structured fields, and keep prompts and constants consistent with the new exclusion and column layout.
context, invited expert derivation without the removed invited table
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3295 +/- ##
==========================================
+ Coverage 79.28% 79.33% +0.04%
==========================================
Files 619 623 +4
Lines 35224 35558 +334
==========================================
+ Hits 27929 28211 +282
- Misses 7295 7347 +52 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
…kend into expert-finder/refactor-expert-search-models-serializers-migrate-expert-results-v2
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What changed
Relational experts (
Expert+SearchExpert)Expert: one row per normalized professional email, withregistered_user,last_email_sent_at, and structured fields (name parts, academic title, affiliation, etc.).SearchExpert: ordered membership linking anExpertto anExpertSearch.This mirrors behavior that existed in ARTEMIS, where a JSON blob was enough; in ResearchHub we normalize that data into proper tables so the same concepts are queryable, deduplicated, and consistent with the rest of the stack.
Why it matters
excluded_expert_namesis removed;excluded_search_ids(other search IDs) drives exclusion via resolved expert IDs from those searches.Expert.registered_userlinks a canonical expert row to a User when someone registers with the same email.Data migration
Expert/SearchExpertfrom the legacy JSON field. It is temporary and can be removed after migration is complete and JSON is no longer the source of truth.Important
Should be released together with ResearchHub/web#758