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

Make licenses searchable and facetable #10204

Conversation

luddaniel
Copy link
Contributor

@luddaniel luddaniel commented Jan 4, 2024

What this PR does / why we need it:

This PR allow user to filter by License via GUI Facets and via Search API fq parameter.

Which issue(s) this PR closes:

Special notes for your reviewer:

There is 2 ideas that I decided to discard :

  • Adding License filtering in MyData API (seems irrelevant)
  • Make License Facet conditioned by a setting (there is no static facet that is configurable in visibility)

Feel free to give your thoughts.

Suggestions on how to test this:

This has been tested with 2 datasets of different licenses and 1 file.

Ex. of search API queries :
http://localhost:8080/api/search?q=*&fq=license%3A%22CC+BY+4.0%22
{"status":"OK","data":{"q":"*","total_count":2

http://localhost:8080/api/search?q=*&fq=license%3A%22CC0+1.0%22
{"status":"OK","data":{"q":"*","total_count":1

Does this PR introduce a user interface change?

GUI demo :

demo_license_facet_search_solr.mp4

Is there a release notes update needed for this change?

Yes

@coveralls
Copy link

coveralls commented Jan 4, 2024

Coverage Status

coverage: 20.154% (-0.01%) from 20.165%
when pulling 69bace8 on Recherche-Data-Gouv:9060-7482-make-licenses-searchable-faceatable
into 871f373 on IQSS:develop.

Copy link
Member

@pdurbin pdurbin left a comment

Choose a reason for hiding this comment

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

I didn't run the code but it looks good and the video is fantastic! I feel vindicated that very little code was required to add this feature! 🎉

I left a few comments. Thanks, @luddaniel! ❤️

@@ -239,7 +239,7 @@ private List<String> getSolrFilterQueries(boolean totalCountsOnly){
//fq=publicationStatus:"Unpublished"&fq=publicationStatus:"Draft"

// -----------------------------------------------------------------
// (4) FQ by dataset metadata vlidity
// (4) FQ by dataset metadata validity
Copy link
Member

Choose a reason for hiding this comment

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

Ha, good catch.

@@ -741,23 +744,23 @@ public SolrQueryResponse search(
// logger.info("field: " + facetField.getName() + " " + facetFieldCount.getName() + " (" + facetFieldCount.getCount() + ")");
String localefriendlyName = null;
if (facetFieldCount.getCount() > 0) {
if(metadataBlockName.length() > 0 ) {
localefriendlyName = getLocaleTitle(datasetFieldName,facetFieldCount.getName(), metadataBlockName);
if(metadataBlockName.length() > 0 ) {
Copy link
Member

Choose a reason for hiding this comment

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

Here and below it looks like we're fixing some whitespace problems. Only three spaces or something.

conf/solr/9.3.0/schema.xml Show resolved Hide resolved
@luddaniel
Copy link
Contributor Author

luddaniel commented Jan 18, 2024

Just added Custom Terms and internationalization on license facet. Also suggestions of first review by @pdurbin.
i18n demo :

demo_license_facet_i18n.mp4

@pdurbin pdurbin changed the title #9060 #7482 Make License searchable and facetable Make licenses searchable and facetable Jan 22, 2024
@qqmyers
Copy link
Member

qqmyers commented Jan 26, 2024

FWIW: QDR is running this in production.

@pdurbin
Copy link
Member

pdurbin commented Jan 27, 2024

FWIW: QDR is running this in production.

Very cool to see this at https://data.qdr.syr.edu !

Screenshot 2024-01-26 at 8 50 41 PM

@philippconzett et al., check it out!

@cmbz
Copy link

cmbz commented Jan 30, 2024

2024/01/29

  • Added to backlog for sizing at @pdurbin request

@qqmyers qqmyers added the Size: 3 A percentage of a sprint. 2.1 hours. label Feb 12, 2024
Copy link
Member

@qqmyers qqmyers left a comment

Choose a reason for hiding this comment

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

Looks like requested changes have been made, so approving so it can move on.

@stevenwinship stevenwinship self-assigned this Feb 29, 2024
@stevenwinship
Copy link
Contributor

QA: works great. Also edited licenses after publishing and was very happy.

@stevenwinship stevenwinship merged commit b62c123 into IQSS:develop Feb 29, 2024
15 checks passed
@stevenwinship stevenwinship removed their assignment Feb 29, 2024
@pdurbin pdurbin added this to the 6.2 milestone Feb 29, 2024
@luddaniel luddaniel deleted the 9060-7482-make-licenses-searchable-faceatable branch September 19, 2024 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Terms & Licensing Size: 3 A percentage of a sprint. 2.1 hours.
Projects
Status: 🚀 Done (Recherche Data Gouv)
Development

Successfully merging this pull request may close these issues.

Make Licenses available as Search Facets Querying waiver/license via dataverse search API
8 participants