Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

License Indexing - stop indexing datasets with no terms as "Custom Terms" #10513

Closed
landreev opened this issue Apr 22, 2024 · 2 comments · Fixed by #10614
Closed

License Indexing - stop indexing datasets with no terms as "Custom Terms" #10513

landreev opened this issue Apr 22, 2024 · 2 comments · Fixed by #10614
Milestone

Comments

@landreev
Copy link
Contributor

This happens in the following method in IndexServiceBean:

private void addLicenseToSolrDoc(SolrInputDocument solrInputDocument, DatasetVersion datasetVersion) {
   if (datasetVersion != null && datasetVersion.getTermsOfUseAndAccess() != null) {
      String licenseName = "Custom Terms";
      if(datasetVersion.getTermsOfUseAndAccess().getLicense() != null) {
         licenseName = datasetVersion.getTermsOfUseAndAccess().getLicense().getName();
      }
      solrInputDocument.addField(SearchFields.DATASET_LICENSE, licenseName);
   }
}

i.e., it assumes that a version with non-null TemsOfUseAndAccess and a null license id uses custom terms. In fact, our versions are always created with empty TermsOfUse; so it is NEVER null. The method above needs to differentiate between a null license_id and some values in the terms (i.e., “Custom Terms”) and completely empty TermsOfUse, aka “no terms”.

Should be a simple fix.

@landreev
Copy link
Contributor Author

(this primarily affects the new "license" facet on the collection page)

@landreev
Copy link
Contributor Author

Also, it is possible that this is unique to datasets harvested in the oai_dc format; and in all other cases some values will be present in the terms.
It still seems to be that what I suggested above cannot hurt - that the code should assume that the terms may be completely empty, and skip indexing them as "custom terms".

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

Successfully merging a pull request may close this issue.

2 participants