NASA-PDS / portal-wp

New PDS Website driven by the PDS Web Modernization Working Group
Apache License 2.0
0 stars 0 forks source link

As a user, I want to select 1 or more filters to facet search results #119

Open jordanpadams opened 3 weeks ago

jordanpadams commented 3 weeks ago

💡 Description

From the initial designs, it was not entirely clear how to implement multi-select faceting. Need improved, detailed workflows for this.

Engineering Details

Generally, the idea for the multi-select faceting is when one value of a particular facet type is selected, that facet type list is "frozen". The counts associated with the values in the list may change, but the values in the list remain constant in order to allow for multi-select.

Key principles:

Success Criteria

The following scenarios walk through a few examples of utilizing the multi-select faceting feature. We will ignore the page type facet field for the time being since it is fairly straightforward how that applies. Shorthand/abbreviations for the queries and names below for simplicity. Use LIDs and the full names in the implementation.

Scenario 1

  1. Select facet_field investigation = MSL (investigations selected = MSL)

    • frozen_facet_fields = investigation
    • to_filter_facet_fields = page_type, instrument, target
    • query solr = fq=ref_investigation:msl
    • investigation facet_field remains fully populated, with msl (167) and the rest have name (0)
    • instrument facet_field only contains values associated with MSL
    • target facet_field only contains values associated with MSL
    • page_type facet_field only contains values associated with ref_investigation:MSL
  2. Select facet_field investigation = M2020 (investigations selected = MSL, Mars 2020)

    • frozen_facet_fields = investigation
    • to_filter_facet_fields = page_type, instrument, target
    • query solr = fq=ref_investigation:msl OR ref_investigation:m2020
    • investigation facet_field remains fully populated, with msl (167) and mars2020 (197) and the rest havename (0)`
    • instrument facet_field only contains values associated with MSL or Mars 2020
    • target facet_field only contains values associated with MSL or Mars 2020
    • page_type facet_field only contains values associated with ref_investigation:MSL or ref_investigation:Mars2020
  3. Select facet_field instrument = mars2020.sherloc (investigations selected = msl, mars2020; instruments selected = mars2020.sherloc)

    • frozen_facet_fields = investigation, instrument
    • to_filter_facet_fields = page_type, ~instrument~, target
    • query solr = fq=ref_investigation:msl OR ref_investigation:m2020&fq=ref_instrument=mars2020.sherloc
    • investigation facet_field remains fully populated, with msl (167) and mars2020 (197) and the rest havename (0)`
    • instrument facet_field contains only instruments associated with msl and mars2020. mars2020.sherloc is selected, with mars2020.sherloc (25)
    • target facet_field only contains values associated with ((msl OR mars2020) AND mars2020.sherloc)
    • page_type facet_field only contains values associated with ((ref_investigation:MSL OR ref_investigation:Mars2020) AND ref_instrument:mars2020.ecam)
  4. Select facet_field instrument = msl.chemcam (investigations selected = msl, mars2020; instruments selected = mars2020.sherloc, msl.chemcam)

    • frozen_facet_fields = investigation, instrument
    • to_filter_facet_fields = page_type, target
    • query solr = fq=ref_investigation:msl OR ref_investigation:m2020&fq=ref_instrument=mars2020.sherloc OR ref_instrument=msl.chemcam
    • investigation facet_field remains fully populated, with msl (167) and mars2020 (197) and the rest havename (0)`
    • instrument facet_field contains only instruments associated with msl and mars2020. mars2020.sherloc is selected with mars2020.sherloc (25) and msl.chemcam (20)
    • target facet_field only contains values associated with ((msl OR mars2020) AND (mars2020.sherloc or msl.chemcam))
    • page_type facet_field only contains values associated with ((ref_investigation:MSL OR ref_investigation:Mars2020) AND (ref_instrument:mars2020.ecam or ref_instrument:msl.chemcam))

Additional Information

Other key principles to keep in mind when implementing faceting (from ChatGPT):

  1. User-Friendly Interface • Clear Labels and Organization: Use clear and intuitive labels for facets and organize them logically (e.g., grouping related facets together). • Multi-Select Capability: Allow users to select multiple values within the same facet (e.g., selecting both "Red" and "Blue" under the "Color" facet). • Checkboxes for Selections: Use checkboxes or toggles for selecting multiple options, making it obvious that users can select more than one. • Search Within Facets: If there are many options within a facet, provide a search bar to quickly filter facet values. • Faceted Search Preview: Show the number of results for each facet value (e.g., "Brand A (24)"), allowing users to see the impact of their selection before applying it.
  2. Dynamic Facet Updates • Real-Time Filtering: Update the results and available facet options in real-time as users make selections, ensuring a smooth and responsive experience. • Adaptive Facets: Dynamically adjust the availability of facet options based on current selections to prevent dead ends (e.g., disabling or hiding facet values that have zero results). • Breadth-First Approach: Consider showing all facet values initially but indicate which have results (or fade out options with zero results) to guide user choices.
  3. Performance Optimization • Indexing and Caching: Use efficient indexing (like Elasticsearch or Solr) and caching mechanisms to speed up search queries, especially for large datasets. • Lazy Loading Facets: Load only the most relevant facets initially, and use lazy loading for additional facets or options when needed. • Debounced Queries: When implementing search-as-you-type within facets, use debounced queries to reduce the number of server requests.
  4. Logical Operators • AND vs. OR Behavior: Clearly define how selections within and across facets work: o Within a Facet: Use an OR operation (e.g., selecting "Red" and "Blue" in "Color" should show items that are either Red OR Blue). o Across Facets: Use an AND operation (e.g., selecting "Red" in "Color" and "Cotton" in "Material" should show items that are both Red AND Cotton). • Negation Options: Consider allowing users to exclude certain values (e.g., "Not Blue"), which can be useful for narrowing down results.
  5. Clear Visual Feedback • Selected Facet Indicators: Clearly show which facets are active, using highlights, bold text, or different background colors. • Removable Facet Chips: Display selected facets as removable chips or tags at the top of the search results, allowing users to quickly deselect them. • Reset Option: Provide a "Clear All" button to reset all facet selections easily.
  6. Scalability and Flexibility • Scalable Data Models: Ensure that the database or search engine is designed to handle large volumes of data and complex queries. • Configurable Facets: Allow admins to configure which facets are displayed, their order, and their default behavior (e.g., collapsed vs. expanded). • Prioritization of Facets: Highlight the most relevant or popular facets based on user behavior or business priorities.
  7. Mobile and Accessibility Considerations • Responsive Design: Ensure the facet panel is responsive and optimized for different screen sizes. On mobile, consider using collapsible sections or sliding panels. • Keyboard and Screen Reader Support: Implement keyboard navigation and screen reader support to ensure the faceted search is accessible to users with disabilities.
  8. Analytics and Continuous Improvement • Track User Interactions: Capture analytics on how users interact with facets (e.g., which facets are most used) to refine the experience over time. • A/B Testing: Experiment with different facet arrangements, labels, or behaviors to determine what works best for your audience. • Feedback Mechanism: Provide a way for users to give feedback if they can't find what they're looking for, which can help identify gaps in the facet options. By following these principles, you can build a robust and intuitive multi-select faceted search that enhances the user experience, drives engagement, and improves findability.
jordanpadams commented 3 weeks ago

@edwardbarraza @eddiesarevalo can you review my success criteria scenario above and let me know if that makes any sense?

jordanpadams commented 3 weeks ago

I can add additional scenarios if needed...