Skip to content

Add facet filters to accession browse page#2207

Open
danloveg wants to merge 11 commits intoartefactual:qa/2.xfrom
danloveg:dev/issue-2159-add-facets-to-accession-browse
Open

Add facet filters to accession browse page#2207
danloveg wants to merge 11 commits intoartefactual:qa/2.xfrom
danloveg:dev/issue-2159-add-facets-to-accession-browse

Conversation

@danloveg
Copy link
Copy Markdown
Contributor

Closes #2159

Adds filters on the accession browse page for the following accession fields:

  • Acquisition type
  • Resource type
  • Processing status
  • Processing priority
  • Donor name
  • Creator name

The first four filters are made possible by #2004, since facet filters use the elastic search index to filter the query.

I was able to remove the query setup from the AccessionBrowseAction::execute function by inheriting from DefaultBrowseAction which already does all of the same query setup.

These changes will also make it easier to implement an advanced search form for accessions in the future if that's a desired change. I'm passing an empty list to the addAdvancedSearchFilters function for now.

accession-facets

Most of the code in this function seemed to be copied from
DefaultBrowseAction::execute, so now I'm just calling that function
instead which simplifies this execute function a lot.
Both the actor and informationobject browse success templates do this,
so I've changed it for consistency.
@danloveg
Copy link
Copy Markdown
Contributor Author

I also fixed the Export CSV button so that it works by exporting only the filtered accessions.

@sarah-mason sarah-mason self-assigned this Nov 3, 2025
@sarah-mason sarah-mason added the Community Pull requests that have been contributed from community members outside Artefactual label Nov 3, 2025
@sromkey sromkey added this to the 2.11 milestone Nov 18, 2025
@sromkey
Copy link
Copy Markdown
Contributor

sromkey commented Nov 18, 2025

Hey @danloveg , thanks for this! We want to give it a close look over since it changes how accession searching works, but will definitely consider for 2.11.

@danloveg
Copy link
Copy Markdown
Contributor Author

Hey @danloveg , thanks for this! We want to give it a close look over since it changes how accession searching works, but will definitely consider for 2.11.

Sounds good, thanks for the update

Comment thread lib/job/arAccessionExportJob.class.php Outdated
->index
->getIndex('QubitAccession')
->createSearch($query->getQuery(false, false));
->createSearch($query->getQuery(false));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This shouldn't make a difference functionally speaking since getQuery should by default be filtering drafts, even if false wasn't passed, but I'm curious if there was a reason this param was removed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I found it wasn't even necessary to call getQuery() since addAdvancedSearchFilters() creates a BoolQuery already. I'm using that here now: e372ba4

Comment on lines -92 to -115
'identifier' => 10,
'donors.i18n.%s.authorizedFormOfName' => 10,
'i18n.%s.title' => 10,
'i18n.%s.scopeAndContent' => 10,
'i18n.%s.locationInformation' => 5,
'i18n.%s.processingNotes' => 5,
'i18n.%s.sourceOfAcquisition' => 5,
'i18n.%s.archivalHistory' => 5,
'i18n.%s.appraisal' => 1,
'i18n.%s.physicalCharacteristics' => 1,
'i18n.%s.receivedExtentUnits' => 1,
'acquisitionType.i18n.%s.name' => 1,
'processingPriority.i18n.%s.name' => 1,
'processingStatus.i18n.%s.name' => 1,
'resourceType.i18n.%s.name' => 1,
'alternativeIdentifiers.i18n.%s.name' => 1,
'creators.i18n.%s.authorizedFormOfName' => 1,
'alternativeIdentifiers.i18n.%s.note' => 1,
'alternativeIdentifiers.type.i18n.%s.name' => 1,
'accessionEvents.i18n.%s.agent' => 1,
'accessionEvents.type.i18n.%s.name' => 1,
'accessionEvents.notes.i18n.%s.content' => 1,
'donors.contactInformations.contactPerson' => 1,
'accessionEvents.dateString' => 1,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I didn't see these weights being set anywhere and I don't think they'd be inherited from the browse action either. Doesn't removing them impact the search result order?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for pointing that out, I didn't consider that.

I found that addAdvancedSearchFilters() makes a call to the setBoostValues() function, so I added boost values for the accession fields that were being boosted previously there. See here: e372ba4

The ordering should be the same now that the fields are boosted properly.

Screenshot 2026-02-18 133658

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

Labels

Community Pull requests that have been contributed from community members outside Artefactual

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhancement: Introduction of facets to Browse accessions display

4 participants