Skip to content

Use Species for allele display names, normalize nameKey field#1540

Merged
oblodgett merged 6 commits intostagefrom
add_species
Mar 27, 2026
Merged

Use Species for allele display names, normalize nameKey field#1540
oblodgett merged 6 commits intostagefrom
add_species

Conversation

@oblodgett
Copy link
Copy Markdown
Member

@oblodgett oblodgett commented Mar 27, 2026

Summary

  • Use Species entity for allele search results: Update AlleleSearchResultConverter to use Species.fullName for the species field and Species.abbreviation for the nameKey suffix (e.g. "allele (Mmu)") instead of the raw NCBITaxonTerm name. Falls back to taxon name if Species is not available.
  • Rename name_key to nameKey everywhere: Remove all snake_case name_key references in favor of camelCase nameKey for consistency with curation API document serialization. This includes ES mappings, search queries, boost functions, autocomplete, response fields, document models (@JsonProperty annotations removed), and test assertions.

Files changed

  • AlleleSearchResultConverter — species/nameKey logic updated to use Species entity
  • Mapping.java / VariantMapping.java — ES field renamed from name_key to nameKey
  • SearchableItemDocument, AlleleSearchResultDocument, VariantSearchResultDocument — removed @JsonProperty("name_key") annotations and unused imports
  • SearchHelper, SearchService, AutoCompleteService, AutoCompleteDAO — all query/field references updated
  • RelatedDataLink — simplified to @Data
  • QueryRankIntegrationSpec — test assertions updated

Test plan

  • Rebuild indices after deploy (mapping change from name_key to nameKey)
  • Verify allele search results show Species fullName for species field
  • Verify nameKey displays with Species abbreviation suffix
  • Verify search autocomplete and boost scoring still work correctly

@oblodgett oblodgett requested a review from a team as a code owner March 27, 2026 00:07
@claude
Copy link
Copy Markdown

claude bot commented Mar 27, 2026

Code Review

Changes look correct. Two small, well-structured changes:

  1. AlleleSearchResultConverter: Properly adds Species-based display names with null-safe fallback to the existing taxon name behavior. Logic is clean.

  2. RelatedDataLink: @Getter @Setter@Data is fine — the class is a simple POJO with no inheritance, so the added equals/hashCode/toString from @Data won't cause issues.

No bugs, no performance concerns, no breaking changes.

Remove all snake_case name_key references in favor of camelCase
nameKey for consistency with curation API document serialization.
Updates ES mappings, search queries, boost functions, autocomplete,
response fields, document models, and test assertions.
@oblodgett oblodgett changed the title Added Species to Allele Use Species for allele display names, normalize nameKey field Mar 27, 2026
@oblodgett oblodgett enabled auto-merge March 27, 2026 17:09
@oblodgett oblodgett disabled auto-merge March 27, 2026 17:13
@oblodgett oblodgett merged commit e0b417d into stage Mar 27, 2026
4 checks passed
@oblodgett oblodgett deleted the add_species branch March 27, 2026 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants