Add facet filters to accession browse page#2207
Add facet filters to accession browse page#2207danloveg wants to merge 11 commits intoartefactual:qa/2.xfrom
Conversation
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.
|
I also fixed the Export CSV button so that it works by exporting only the filtered accessions. |
|
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 |
| ->index | ||
| ->getIndex('QubitAccession') | ||
| ->createSearch($query->getQuery(false, false)); | ||
| ->createSearch($query->getQuery(false)); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
I found it wasn't even necessary to call getQuery() since addAdvancedSearchFilters() creates a BoolQuery already. I'm using that here now: e372ba4
| '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, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Closes #2159
Adds filters on the accession browse page for the following accession fields:
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::executefunction by inheriting fromDefaultBrowseActionwhich 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
addAdvancedSearchFiltersfunction for now.