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

Move publication status facet from bottom to where it used to be #10338

Closed
scolapasta opened this issue Feb 22, 2024 · 4 comments · Fixed by #10408
Closed

Move publication status facet from bottom to where it used to be #10338

scolapasta opened this issue Feb 22, 2024 · 4 comments · Fixed by #10408
Assignees
Labels
Size: 3 A percentage of a sprint. 2.1 hours.
Milestone

Comments

@scolapasta
Copy link
Contributor

In one of our recent releases, the publication status facet location was inadvertently moved to the bottom of the facet list. Let's move it back to where it used to be.

@scolapasta scolapasta added this to the 6.2 milestone Feb 22, 2024
@sekmiller sekmiller changed the title Move puvlication status facet from bottom to where it used to be Move publication status facet from bottom to where it used to be Feb 22, 2024
@scolapasta
Copy link
Contributor Author

scolapasta commented Feb 22, 2024

When we did some optimization for solr, a call in SearchIndexBean search method to a method called getPermissionFilterQuery got moved from before the dynamic facets were added to after. One thing this method did behind the scenes is add the publication_status facet (since this only shows if you are logged in).

To fix, we could either a) see if it can be moved back to where it was, OR since it was likely moved for good recent, be could try to leave it there, but be more judicous in adding the facet to the list (i.e. don't add it to the end, but between other facets. Of course, in this scenario, we should be careful to see where (i.e. would it always be the nth place?).

@scolapasta scolapasta moved this to SPRINT- NEEDS SIZING in IQSS Dataverse Project Mar 14, 2024
@cmbz cmbz added the Size: 3 A percentage of a sprint. 2.1 hours. label Mar 14, 2024
@cmbz cmbz moved this from SPRINT- NEEDS SIZING to SPRINT READY in IQSS Dataverse Project Mar 14, 2024
@scolapasta scolapasta moved this from SPRINT READY to This Sprint 🏃‍♀️ 🏃 in IQSS Dataverse Project Mar 15, 2024
@jp-tosca jp-tosca self-assigned this Mar 20, 2024
@jp-tosca jp-tosca moved this from This Sprint 🏃‍♀️ 🏃 to In Progress 💻 in IQSS Dataverse Project Mar 20, 2024
@jp-tosca
Copy link
Contributor

jp-tosca commented Mar 21, 2024

For reference #10050 (fixes #9635) seems to be the PR that closed the mentioned issue by @scolapasta.

SearchServiceBean is the class that contains search() and getPermissionFilterQuery()

Addition of the publication_status facet.

@jp-tosca
Copy link
Contributor

jp-tosca commented Mar 21, 2024

It seems to me that the only difference is that on the current version, there is a validation to check addFacets while on the previous one was not, it seems that everything else is being executed on the same order 🤔

if (addFacets) {
// Logged in user, has publication status facet
//
solrQuery.addFacetField(SearchFields.PUBLICATION_STATUS);
}

solrQuery.addFacetField(SearchFields.PUBLICATION_STATUS);

Probably this change is older than I initially thought ❓

@qqmyers
Copy link
Member

qqmyers commented Mar 21, 2024

Check where getPermissionFilterQuery is called relative to where other facets are, e.g.

if (dataverses != null) {
for (Dataverse dataverse : dataverses) {
if (dataverse != null) {
for (DataverseFacet dataverseFacet : dataverse.getDataverseFacets()) {
DatasetFieldType datasetField = dataverseFacet.getDatasetFieldType();
solrQuery.addFacetField(datasetField.getSolrField().getNameFacetable());
}
// Get all metadata block facets configured to be displayed
metadataBlockFacets.addAll(dataverse.getMetadataBlockFacets());
}
}
}
solrQuery.addFacetField(SearchFields.FILE_TYPE);
/**
* @todo: hide the extra line this shows in the GUI... at least it's
* last...
*/
solrQuery.addFacetField(SearchFields.FILE_TAG);
if (!systemConfig.isPublicInstall()) {
solrQuery.addFacetField(SearchFields.ACCESS);
}
}
vs
solrQuery.addFacetField(SearchFields.FILE_TYPE);
/**
* @todo: hide the extra line this shows in the GUI... at least it's
* last...
*/
solrQuery.addFacetField(SearchFields.TYPE);
solrQuery.addFacetField(SearchFields.FILE_TAG);
if (!systemConfig.isPublicInstall()) {
solrQuery.addFacetField(SearchFields.ACCESS);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Size: 3 A percentage of a sprint. 2.1 hours.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants