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

Allow users to exclude one or more facet values from search results #4222

Open
andrewjbtw opened this issue Oct 9, 2023 · 7 comments
Open
Assignees
Labels
discovery improvements to discovery

Comments

@andrewjbtw
Copy link

andrewjbtw commented Oct 9, 2023

This is an update to #921

Users have requested the ability to exclude sets of search results based on facet values. The idea would be to:

  • Go to the facet list
  • Select a value from the facet to be excluded from the search results

Example limits:

  • show me all results where the access rights are NOT dark
  • show me all items where the processing status is NOT registered

See screenshot and link for the design, which includes an outline of how the interaction would work as a sequence of steps:

Screenshot 2023-10-09 at 14-16-06 exclude
https://projects.invisionapp.com/share/B813BT2Q9MRH#/screens/474829031_exclude

Additional context

There are a few Blacklight installations with this functionality, though they have different UI implementations. For example, this search in Columbia's catalog shows a set of results where the format is "FOIA Document" and the subject is NOT "Clinton, Hillary Rodham". Note that the choice they made is to allow users to choose "IS" or "IS NOT" in the list of selected facets just above the search results. They do also show the "NOT" in the sidebar once it's selected but it doesn't look like it's possible to choose a NOT directly from the facet lists.

If this can only be done for certain facets

If this can only be enabled for certain facets, I would pick from these 5

  • Processing status
  • Access rights
  • Content type
  • Collection
  • APO

The first three of those have essentially a fixed number of possible values, the other two are not similarly bounded.

@ndushay
Copy link
Contributor

ndushay commented Oct 10, 2023

Maybe we can do something relatively "easy" like

   config.add_facet_field 'identifiers', label: 'Identifiers',
                                          component: true,
                                          query: {
                                            has_orcids: { label: 'Has contributor ORCIDs',
                                                          fq: '+contributor_orcids_ssim:*' },
                                            has_doi: { label: 'Has DOI', fq: '+doi_ssim:*' },
                                            has_barcode: { label: 'Has barcode', fq: '+barcode_id_ssim:*' }
                                          }

see https://github.com/sul-dlss/argo/blob/main/app/controllers/catalog_controller.rb#L156-L163

OR

We may be able to leverage Columbia's work. I think this may be part of their key: https://github.com/cul/clio-spectrum/blob/main/app/controllers/catalog_controller.rb#L260

I think we can do this in the URL (note the minus sign before the facet field name):

https://argo-qa.stanford.edu/catalog?f[-collection_title_ssim][]=Arrowroot+Curry+Leaves
vs
https://argo-qa.stanford.edu/catalog?f[collection_title_ssim][]=Arrowroot+Curry+Leaves

@ndushay
Copy link
Contributor

ndushay commented Oct 10, 2023

From JCoyne:

I think you're looking for cul/clio-spectrum@2d04055 - " But that was written 10 years ago so it’ll need to be forward ported to whatever version of BL you’re on now"

@mjgiarlo mjgiarlo self-assigned this Oct 10, 2023
@andrewjbtw
Copy link
Author

I added a top 5 list of facets to the original description if it turns out it's more viable to enable this on a per-facet basis.

@mjgiarlo
Copy link
Member

@andrewjbtw @astridu I've started spiking on this in Blacklight, and I have an approach that has the baseline functionality working (for a very small sample size). I need technical feedback to make it scalable and palatable to the community, but once I get that, I'll want to turn to implementing the UI design so that I no longer need to manually hack the URL to drive this functionality. The UI design above looks great! I believe we need one additional design, namely for the little constraint buttons that render as you add more facets. So, for example:

Screenshot from 2023-10-12 16-36-54

This example shows what the constraint buttons show when faceting for all docs that have English as a language and German as a language. How would this look when showing all docs that have English as a language EXCLUDING docs with German as a language?

@astridu
Copy link

astridu commented Oct 17, 2023

Yes, I can do that. Could I get it to you by 10/27, or do you need it sooner?

@mjgiarlo
Copy link
Member

@astridu No rush. 😄 Thank you!

@astridu
Copy link

astridu commented Nov 1, 2023

Here is an option. We would probably want to test it before it went out, but if you're looking for a way to prototype it, this could work.
image

@ndushay ndushay added the discovery improvements to discovery label Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discovery improvements to discovery
Projects
None yet
Development

No branches or pull requests

5 participants