Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Normalize version_id for minor versions, e.g. 100.2 < 100.20 #16

Merged
merged 1 commit into from
Oct 5, 2023

Conversation

c-suh
Copy link
Contributor

@c-suh c-suh commented Oct 4, 2023

🗒️ Summary

Note: since this uses SolrCloud, it requires a single shard to use the collapse function

Steps for normalizing version_id:

  • split version_id into major and minor versions
  • pad the minor version
  • concatenate the major and padded minor versions
  • format the string to the maximum number of decimal places for a float
  • convert to a number

Examples (preformatted for easier viewing of number of digits):

100.2 becomes
100.00002
100.20 becomes
100.0002
2.40 becomes
  2.0004

⚙️ Test Data and/or Report

test_solr_doc.normalize_versions_good.xml.txt

♻️ Related Issues

Fixes NASA-PDS/registry-legacy-solr#91
Known bug described in NASA-PDS/registry-legacy-solr#82

Copy link
Member

@nutjob4life nutjob4life left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Plan / implement solution for handling multiple versions of products in search results
3 participants